Can arrays handle numbers and text?

Get help using Construct 2

Post » Fri May 29, 2015 5:52 pm

Can a single array hold both numbers and text at differing indexes?
B
3
Posts: 8
Reputation: 191

Post » Fri May 29, 2015 7:08 pm

Apparently it can. Justed tested it myself.
B
4
Posts: 33
Reputation: 266


Post » Fri May 29, 2015 10:21 pm

I have not used an array in C2 yet, but if its like other programming languages an array should be able to store those things, you would just need to convert them to integer (Int()) or String (str()) first to match the array type (if its string or integer) but i dont think this is an issue for C2, im under the idea that C2 will convert it automatically so you should be good
B
5
Posts: 48
Reputation: 319

Post » Sun May 31, 2015 6:51 am

Yes it does ;) But I'm using arrays for numbers only and for strings dictionaries. Both can be easily saved in Web/LocalStorage (AsJSON).
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,117
Reputation: 27,781


Return to How do I....?

Who is online

Users browsing this forum: eochranek, fearfulelephants, plinkie and 19 guests