covaks Posted February 8, 2008 Share Posted February 8, 2008 So, today is the 8th, and @MDAY = "08". Shouldn't @MDAY -1 = "07"? Instead, msgbox(1,"",@MDAY -1) returns "7".. Similarly, adding to @MDAY also removes the leading 0 for dates between 01-09. Is this a bug? Or am I not adding/subtracting from @MDAY properly? Or is it just not meant for that kind of thing? Link to comment Share on other sites More sharing options...
rasim Posted February 8, 2008 Share Posted February 8, 2008 So, today is the 8th, and @MDAY = "08". Shouldn't @MDAY -1 = "07"?Instead, msgbox(1,"",@MDAY -1)returns "7".. Similarly, adding to @MDAY also removes the leading 0 for dates between 01-09. Is this a bug? Or am I not adding/subtracting from @MDAY properly? Or is it just not meant for that kind of thing?Do this action in calculator. 08 - 1 = 7, 0 is omitted. Link to comment Share on other sites More sharing options...
whim Posted February 8, 2008 Share Posted February 8, 2008 Most macro's are strings. In order to perform any calculation on them, they will automatically be converted to the appropiate variable type by AutoIt. At least, that's my understanding of & experience with them Link to comment Share on other sites More sharing options...
covaks Posted February 8, 2008 Author Share Posted February 8, 2008 Yeah, I guess that makes sense. There's no "Date" type, so it doesn't make sense for me to expect a 07.. I'm just tired, not thinking straight.. heh. I fixed my problem by adding a check for days between 01-09 and just adding the "0" manually. Thanks. Link to comment Share on other sites More sharing options...
weaponx Posted February 8, 2008 Share Posted February 8, 2008 MsgBox(0,"",StringFormat("%02d", @MDAY-1)) Link to comment Share on other sites More sharing options...
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