Posted: Tue Dec 24, 2002 5:38 pm Post subject: too many variables?
hi everyone, what i'm trying to do with my program is i'll have 5 litlte buttons, and the buttons will change when the user runs their mouse over it. So let's say for button 1 i have 2 variables for it, one contains the pic b4 the mouse is run over, the 2nd contains the pic that will be dispalyed when the mouse is over it.
Now my question is, i'll have to do that for all 5 buttons, so does that mean i'll have to declare 10 variables? since i'll need 2 for each button? that seems to take a lot of...well variables and i don't know if there's a limit of the amoutn of varaibles i can declare.
is there a more efficient way of doing this? or will i really have to declare a variable for every single pic i put on screen?
Posted: Tue Dec 24, 2002 6:20 pm Post subject: (No subject)
try using arrays.
var picID : array 1..5, 1..2 of int
picID(i,i2) := Pic.FileNew("image"+i+i2)
Posted: Sat Dec 28, 2002 10:23 pm Post subject: (No subject)
hmm yeah, but then each button woudl have a differnet file. Example (the goal here is that i have 5 levels, and the user select which lvl they want. So lvl 1 would have 2 pics, but ecah lvl's pic is differnt, cuz the pic woudl say lvl 1 for lvl1, lvl 2 for lvl 2, etc)
So what i did was i used arry to delcare all the variables, and then i just took ecah one and idenfied it. So i have something like
var buttons : array 1 .. 5 of int
var buttons2 : array 1 .. 5 of int