verifying a character

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
doobster
Newbie
Posts: 1
Joined: Thu Mar 06, 2003 6:53 pm

verifying a character

Post by doobster » Thu Mar 06, 2003 6:57 pm

Hello I have a script that opens a file in Notepad. I use the find to look for a word. I then copy the two characters after the word I was searching for. I then open the find dialog again and paste the two characters I then append a few characters to the search string and search for it. However before appending I wish to check the last character that I pasted in the Find dialog and see if it is equal to a " and if it is I want to delete that " before appending my text.

Could someone please give me some scripting to make this happen.

Thanks

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Thu Mar 06, 2003 7:27 pm

Hi,


Label>start
..
.. here is your code where you copy the
.. two chars from notepad
..
//Get the clipboard contents into a variable
GetClipBoard>twochars

//check the length is in fact 2 chars:
Length>twochars,ltc
//if not 2 try again? (Just an example)
If>ltc2,start

//See if the last char is a "
MidStr>twochars,2,1,qchar
If>qchar=",removequote,continue

Label>removequote
//we want only the first char
MidStr>twochars,1,1,twochars

Label>continue
..
.. here you carry on and paste 'twochars' into the find dialog
.. and do what you normally do
..
MJT Net Support
[email protected]

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts