Guest keystrokeelim Posted July 20, 2005 Posted July 20, 2005 Hello, I am new to this, but find it quite useful. To streamline one funtion, I would like to replace some text. Is it possible? The data is "pasted" into an index value in a database. While it is highlighted in the index field is it possible to check the value, "AA" for example, and replace with another value, "CAT" if it is AA. Otherwise, just continue on with the script. I have played around with stringreplace, but can't get it to work. Perhaps it was intended for something else. Any help would be greatly appreciated.
Developers Jos Posted July 20, 2005 Developers Posted July 20, 2005 Hello,I am new to this, but find it quite useful. To streamline one funtion, I would like to replace some text. Is it possible? The data is "pasted" into an index value in a database. While it is highlighted in the index field is it possible to check the value, "AA" for example, and replace with another value, "CAT" if it is AA. Otherwise, just continue on with the script. I have played around with stringreplace, but can't get it to work. Perhaps it was intended for something else. Any help would be greatly appreciated.<{POST_SNAPBACK}>Make sure you have the format:$var = StringReplace($Var,"Cats","Dogs")If that doesn't solve it show us the script codeyou have problems with... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Guest keystrokeelim Posted July 20, 2005 Posted July 20, 2005 Make sure you have the format:$var = StringReplace($Var,"Cats","Dogs")If that doesn't solve it show us the script codeyou have problems with...<{POST_SNAPBACK}>Ok...here is the last bit of code. (I didn't want to post 200 lines of sloppy stuff)I have a Dim $var = "AA" at the very top of the code. It still does not seem to work. Again, this is a value in a database field. Hopefully it is something simple. Thanks for you assistance.Send("+{INSERT}")MouseMove(353, 101)Sleep(500)MouseClick("left");Clear NotepadWinActivate("Untitled - Notepad")WinWaitActive("Untitled - Notepad")Send("{RIGHT 1}")Send("^A")Send("{DEL}")WinKill("Untitled - Notepad")MouseClick("left");Send("{HOME}")$var = StringReplace($Var,"AA","CAT")
Developers Jos Posted July 20, 2005 Developers Posted July 20, 2005 Ok...here is the last bit of code. (I didn't want to post 200 lines of sloppy stuff)I have a Dim $var = "AA" at the very top of the code. It still does not seem to work. Again, this is a value in a database field. Hopefully it is something simple. Thanks for you assistance.<{POST_SNAPBACK}>Well this code proves that the StringReplace works...Dim $var = "AA" $var = StringReplace($Var,"AA","CAT") MsgBox(262144,'Debug line ~3','Selection:' & @lf & '$var' & @lf & @lf & 'Return:' & @lf & $var);### Debug MSGBOXNot sure what you are trying to do and what you mean by database field ...you can also PM the sloppy script so i can have a look at it... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
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