Jpizzo 0 Posted April 8, 2016 Report Share Posted April 8, 2016 (edited) Guys, I am having trouble setting a variable with four numbers, ex: 0000, and having it increment 0001, 0002, 0003, etc. Any tips? Sorry I posted this in the wrong spot Edited April 8, 2016 by Jpizzo Quote Link to post Share on other sites
deliter 203 Posted April 8, 2016 Report Share Posted April 8, 2016 You willl need to join the variable,create a new variable,as its value put in 000 and drag in your variable Also do a if else if statement If variable is greater than 9,new variable is 00+your variable etc Quote Link to post Share on other sites
HelloInsomnia 1103 Posted April 8, 2016 Report Share Posted April 8, 2016 You will have to modify this to your own needs (remove the wait, change the loop while number) but it shows how you can do this: ui stat monitor("Number:",#num) set(#increment,0,"Global") set(#num,0000,"Global") loop while($comparison(#num,"<",1001)) { increment(#increment) set(#zeroes_count,$subtract(4,$text length(#increment)),"Global") if($comparison(#zeroes_count,"=",3)) { then { set(#zeroes,000,"Global") } else if($comparison(#zeroes_count,"=",2)) { set(#zeroes,00,"Global") } else if($comparison(#zeroes_count,"=",1)) { set(#zeroes,0,"Global") } else { set(#zeroes,$nothing,"Global") } } set(#num,"{#zeroes}{#increment}","Global") wait(0.01) } Quote Link to post Share on other sites
pash 504 Posted April 9, 2016 Report Share Posted April 9, 2016 try "$pad tex" function alert($pad text(1,0,4,"Left")) 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.