WebStorage Variable Types

Discussion and feedback on Construct 2

Post » Wed Jul 04, 2012 7:59 pm

Hey,
Would there be any way to set a variable type for WebStorage Variables? Because it seems to me that they are always strings, and in order to work with an integer from WebStorage you have to use int(WebStorage.LocalValue("key")) - which can get annoying. And integers take up less space than Strings - heck, maybe even give an option to use Bytes in C2 - but without going there, I would really like to see more control over what kind of variable you are storing in WebStorage.
Thanks!
B
40
S
8
G
6
Posts: 61
Reputation: 5,951

Post » Thu Jul 05, 2012 12:07 am

It's a good idea, but browsers simply only store strings in WebStorage. So in the interest of simplicity, instead of building some proprietary incompatible type-system specifically for C2 on top of WebStorage, it just uses strings only as well.
Scirra Founder
B
363
S
216
G
75
Posts: 23,122
Reputation: 180,543

Post » Thu Jul 05, 2012 2:30 am

I thought that might be the problem - thanks for answering! I'll just manage with the functions.
B
40
S
8
G
6
Posts: 61
Reputation: 5,951


Return to Construct 2 General

Who is online

Users browsing this forum: Eisenhans and 7 guests