Sign in to follow this  
Followers 0
Guest keystrokeelim

Replace text

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



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...


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 Notepad

WinActivate("Untitled - Notepad")

WinWaitActive("Untitled - Notepad")

Send("{RIGHT 1}")

Send("^A")

Send("{DEL}")

WinKill("Untitled - Notepad")

MouseClick("left")

;Send("{HOME}")

$var = StringReplace($Var,"AA","CAT")

Share this post


Link to post
Share on other sites

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 MSGBOX

Not 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... :)


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0