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,941

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
359
S
214
G
72
Posts: 22,946
Reputation: 178,518

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,941


Return to Construct 2 General

Who is online

Users browsing this forum: anty21ro and 10 guests