Subroutine

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

Post Reply
macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Subroutine

Post by macrunning » Wed Jun 08, 2005 9:32 pm

I'm attempting to run the following script and use the if statement to run the Sub routine 7 times. Problem is it seems to skip over the subroutine.
Anyone got any ideas on what I'm doing wrong?

//AFTER OPENING NOTEPAD
Press Alt
Send>fo
Release Alt
Wait>1
Send>C:\Documents and Settings\Evergreen\Desktop\new_veh.txt
Press Enter
Wait>1
Press Shift
Press Down * 11
Release Shift
Press Del
Press Ctrl
Press End
Release Ctrl
Press Shift
Press Up * 20
Release Shift
Press Backspace * 2
Press Ctrl
Press Home
Release Ctrl

Let>GetCount=0
Let>GetMax=8
Let>GetCount=%GetCount% + 1
Wait>1
If>%GetCount% wordFind
Press Ctrl
Send>F
Release Ctrl
Send>CLNT
Press Enter
SetFocus>new_veh.txt - Notepad
Press Backspace * 5
Press Shift
Press Down * 5
Release Shift
Press Del
SetFocus>Find
End>wordFind

Press Alt
Send>fs
Release Alt

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

Post by support » Wed Jun 08, 2005 9:55 pm

Your If line should be:

If>GetCount<GetMax,wordFind

Note quite sure how this is supposed to run the subroutine 7 times though.
MJT Net Support
[email protected]

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Post by macrunning » Wed Jun 08, 2005 10:27 pm

I'm not sure either. Thats why I'm posting? But shouldn't the subroutine run every time the %GetCount% is less than the %GetMax%? If not then I'm a bit confused as to how to get the subroutine to run multiple times.

User avatar
JRL
Automation Wizard
Posts: 3529
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Jun 08, 2005 10:45 pm

You have to make a loop to increment "GetCount"

Let>GetCount=0
Let>GetMax=8
Label>GetCountLoop
Let>GetCount=%GetCount% + 1
Wait>1
If>%GetCount%GetCountLoop

Label>continue
///The rest of your macro

the "continue" label gets you out of the loop when you reach %GetMax%.

Hope this helps,
Dick

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Post by macrunning » Wed Jun 08, 2005 11:03 pm

Thanks that seems to make sense. Appreciate the help.

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