Killer Posted June 9, 2006 Posted June 9, 2006 In autoit, if I set a variable to a number example 08, autoit will display the number as only 8. Is there anyway to force it to display the number as it is - 08?
MFerris Posted June 9, 2006 Posted June 9, 2006 (edited) In autoit, if I set a variable to a number example 08, autoit will display the number as only 8. Is there anyway to force it to display the number as it is - 08? You'd have to set it between quotes, forcing into a string format. $num = "08" Note that since this is now a string, you would need to convert it back to a number format if you're doing any calculations that rely on it being the number 8. If that's the case, you can switch back by using Int(), ie; Int($num) ...would return the number 8. Edited June 9, 2006 by MFerris
Moderators SmOke_N Posted June 9, 2006 Moderators Posted June 9, 2006 You could use StringFormat also: $Var2 = 8 $Replace = StringReplace(StringFormat('%2g', $Var2), ' ', 0) MsgBox(0, 'Test2', $Replace) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Killer Posted June 9, 2006 Author Posted June 9, 2006 Thanks for the help. I will try to understand the concepts.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now