Its a common practice in programming to do something like array[counter plusplus (this board wont let me write it)] so you dont have to write array[1] array[2], dont have to type the numbers in. Is there any way to do this in the editor, and no im not talking about loops.
I have kinda a way around this, which I use and it works well for me (I set a lotttt of variables)
Where "index" is an integer variable
Modify "LV_index" +1
Set "GV_Array["LV_index"]" = whatever
Set "GV_Array2["LV_index"]" = whatever
Set "GV_Array3["LV_index"]" = whatever
Set "GV_Array4["LV_index"]" = whatever
Modify "LV_index" +1
Set "GV_Array["LV_index"]" = whatever
Set "GV_Array2["LV_index"]" = whatever
Set "GV_Array3["LV_index"]" = whatever
Set "GV_Array4["LV_index"]" = whatever
Modify "LV_index" +1
Set "GV_Array["LV_index"]" = whatever
Set "GV_Array2["LV_index"]" = whatever
Set "GV_Array3["LV_index"]" = whatever
Set "GV_Array4["LV_index"]" = whatever
I hope you get the idea. This saves me from entering "1, 2, 3" ect into all of the little boxes. In some situations, I do it with multi-dimensional arrays as well, using LV_Index2 ect, for additional dimensions.
Its a common practice in programming to do something like array[counter plusplus (this board wont let me write it)] so you dont have to write array[1] array[2], dont have to type the numbers in. Is there any way to do this in the editor, and no im not talking about loops.
thanks.
What exactly do you mean? You can of course specify a variable as array index.
However, you can't increment the variable directly within the arrays index, like array[index + + ], since there is no pre-/postincrement in galaxy.
PS: I see why your post was looking so weird now. :D
@Mille25: Go
that answers my question thanks. Surprising a C based language wouldnt be able to do that.
@lemmy734: Go
Yep, it sucks. Consider galaxy more like a light scripting language than a mighty, full blown programming language.
However, its enough for pretty much everyting you will need. There is always a workaround, sometimes its ugly, but it works.
I have kinda a way around this, which I use and it works well for me (I set a lotttt of variables)
Where "index" is an integer variable
Modify "LV_index" +1
Set "GV_Array["LV_index"]" = whatever
Set "GV_Array2["LV_index"]" = whatever
Set "GV_Array3["LV_index"]" = whatever
Set "GV_Array4["LV_index"]" = whatever
Modify "LV_index" +1
Set "GV_Array["LV_index"]" = whatever
Set "GV_Array2["LV_index"]" = whatever
Set "GV_Array3["LV_index"]" = whatever
Set "GV_Array4["LV_index"]" = whatever
Modify "LV_index" +1
Set "GV_Array["LV_index"]" = whatever
Set "GV_Array2["LV_index"]" = whatever
Set "GV_Array3["LV_index"]" = whatever
Set "GV_Array4["LV_index"]" = whatever
I hope you get the idea. This saves me from entering "1, 2, 3" ect into all of the little boxes. In some situations, I do it with multi-dimensional arrays as well, using LV_Index2 ect, for additional dimensions.
Skype: [email protected] Current Project: Custom Hero Arena! US: battlenet:://starcraft/map/1/263274 EU: battlenet:://starcraft/map/2/186418
@GlornII: Go
Yeah i do that too sometimes, i just dont like having extra lines of code in there but it does help write it faster.
Yeah, exactly thats the point.
Galaxy supports "+=", but this operation doesnt seem to return the integer value after modification.
As an example, array[index+=1] wont compile, even though the operator exists.