Question on localstorage - missing, exists and get

Get help using Construct 2

Post » Thu Dec 01, 2016 11:19 pm

I read that 'get' is now deprecated. So, would this be correct?

Localstorage > on item X missing - localstorage > set item X to X Global Variable

Localstorage > on item X exists - localstorage > set item X to localstorage.itemvalue
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Thu Dec 01, 2016 11:25 pm

Yes, that is sufficient.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Thu Dec 01, 2016 11:32 pm

@blackhornet

When you say sufficient, you're making me think there's a better way?
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Thu Dec 01, 2016 11:52 pm

No. "Get" is unnecessary if you are calling "exists" anyway.
ImageImageImage
B
71
S
22
G
241
Posts: 3,734
Reputation: 134,494

Post » Fri Dec 02, 2016 12:04 am

@blackhornet

Cool. Ty, sir
B
38
S
18
G
19
Posts: 664
Reputation: 14,107


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 36 guests