Blockland Forums > Modification Help
Using %blah['blah'] stuff.
<< < (4/6) > >>
Chrono:

--- Quote from: Ephialtes on October 14, 2010, 05:40:23 PM ---Yeah but how? You can't even pass an array as a parameter. That's absurd?

--- End quote ---
True.
Uristqwerty:
A terrible feature that can act like an array is still far better than no array at all. Also, rather than set each array item, why not load from a file into the array? Easier to change, data removed from code, you can have it dynamically find the upper bound at load-time.

Also: array as a parameter: Can be done, if the array is defined on a scriptObject, although that is barely better than making it global...


Anyway, more on topic:
You can use an array anywhere you can use a regular variable, it isn't that hard to use once you know how.
otto-san:

--- Quote from: Uristqwerty on October 14, 2010, 06:20:05 PM ---You can use an array anywhere you can use a regular variable, it isn't that hard to use once you know how.

--- End quote ---
i already knew this

i just want to know how to set them. :U
Uristqwerty:
How do you set %i? %i[3] works identically. It will automatically add a new variable when you use a new index. %a["stuff"] is also valid, and you do not need to define it ahead of time. Other variables, too. %a[getrandom(0, 999999999999999) @ "blocks"] is a perfectly valid variable, though good luck ever finding it again... (without srand, of course)
otto-san:
so if i did something like

%client.bear[1] = 5;
%client.bear[2] = 6;

I'd be able to echo %client.bear[1] and it'd be 5, and %client.bear[2] would be 6?
Navigation
Message Index
Next page
Previous page

Go to full version