KellyWiegand
2 years agoOccasional Contributor
How to add a half-Auto-Increment variable?
Hi,
I want to add a variable which is like 'test10','test11','test12','test13'......it had a string part, and the number part can auto-increase. It's better if it can be a random number.
I know it can work by using the data-driven-loop, but how can I make it by variables and script?
Thank you!
For example,
function main() { var name = "Test"; var number = 0; for (var i = 0; i < 10; i++) { number = i; // increment Log.Message(name + number.toString()); } Log.Message(Math.floor(Math.random() * 10)); // Returns a random integer from 0 to 9 }