Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by paulh

What am i doing wrong here :-(

                n=ig.game.string_length; // this is a number 1

		console.log("ig.game.string"+n); // appending the number to the strings name

		console.log(ig.game.string1.length); // returns 15

        ]


So string.length returns the numbers of characters in the name "ig.game.string"+n

i want it to return the number of characters in ig.game.string1 which is a defined string.

Trying to get rid of large switch statement by updating the string name in the for loop...

1 decade ago by Heiko

try ig.game['string' + n].length
Page 1 of 1
« first « previous next › last »