kapowdude Posted October 15, 2005 Posted October 15, 2005 ack this is the second time I've written this... Well uh its been quite a long time since i last used auto it and my skills are a bit rusty... i was wondering is it possible to change a variable ex: $date = _DateNow therefore: $date = 10/15/05 now what if i wanted the date to just be: $date = 101505 also if i wanted to add another character to the variable such as a: $date = 101505a how would this be possible... I'm guessing it has to deal with strings... thanks for your help in advanced
Valuater Posted October 15, 2005 Posted October 15, 2005 Like this $Date = "10/15/05" $Date = StringReplace($Date, "/", "") $Date = $Date & "a" MsgBox(0, "New string is", $Date) 8)
kapowdude Posted October 16, 2005 Author Posted October 16, 2005 (edited) ahh... i thought it was something simple like that... thanks just wondering.. for future reference how would you add a symbol like a in the middle of 101505 ex. 101a505 EDIT: also on a random note how do you get the X button in a gui script to work Case $get = $GUI_EVENT_CLOSE Exit EndSelect doesnt seem to work Edited October 16, 2005 by kapowdude
MHz Posted October 16, 2005 Posted October 16, 2005 (edited) a is not a number so will treat it like a string. ; Just in the middle $date = String(101505) $date = StringLeft($date, 3) & 'a' & StringRight($date, 3) MsgBox(0, '', $date) ; Between 15 only $date = String(101505) $date = StringReplace($date, '15', '1a5') MsgBox(0, '', $date) For your close issue. Are you using $get = GuiGetMsg() in your loop? Edited October 16, 2005 by MHz
kapowdude Posted October 16, 2005 Author Posted October 16, 2005 For your close issue. Are you using$get = GuiGetMsg()in your loop?yeahWhile 1 $get= GUIGetMsg () Select Case $get = $GUI_EVENT_CLOSE Exit EndSelect ;rest of script goes herealso im not getting how these return values / @error works (i'm a complete noob)say im doing an inetget and the page doesnt exist it would have a return value of 0, but the function inetget returns something from the internet so you would use @error right?so say:If Inetget (blah blah blah) @error then msgbox (0, "error","an error occured")but that doesnt seem to work..how would do do something with a normal return such as 0 or 1 such as a msgbox
MHz Posted October 16, 2005 Posted October 16, 2005 No @error return for InetGet() so you can use the true or false concept for 1 and 0. Any number other then 0 is true. If Not True Then MsgBox. If Not InetGet() Then MsgBox() 1 = True. MsgBox will show. If 1 Then MsgBox() Not 1 = False. MsgBox will not show. If Not 1 Then MsgBox() 0 = False. MsgBox will not show. If 0 Then MsgBox() Not 0 = True. MsgBox will show. If Not 0 Then MsgBox() Your full of questions. HTH
LxP Posted October 17, 2005 Posted October 17, 2005 also on a random note how do you get the X button in a gui script to workCase $get = $GUI_EVENT_CLOSE Exit EndSelectdoesnt seem to workHave you included this line at the top of your script? --#Include <GUIConstants.au3>Otherwise AutoIt won't know what $GUI_EVENT_CLOSE signifies.
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