adjusting var in a loop

For questions about using Classic.

Post » Sun Oct 11, 2009 8:28 pm

formation.Value('pos1x')

i need the 1 to change with the loopindex,

how do i write this?
B
2
G
3
Posts: 72
Reputation: 994

Post » Sun Oct 11, 2009 9:09 pm

This is not possible, you cannot change the name of the variable you want at runtime. You could try another data storing object, like Hash Table.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,630

Post » Sun Oct 11, 2009 9:22 pm

thanx for clearing that up

and what about this:

set variable targetx to

formation.ImagePointX("pos" & loopindex & "x")

in the text object i seems to say pos5x so thats ok but it doesnt give the value to the targetx var
B
2
G
3
Posts: 72
Reputation: 994

Post » Sun Oct 11, 2009 9:44 pm

ahh it works now

formation.ImagePointX("pos" & loopindex)

i was referring to a wrong name of the imagepoint
B
2
G
3
Posts: 72
Reputation: 994


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests