Ignoring the end of my subroutines

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Robertbob
Newbie
Posts: 2
Joined: Wed Dec 22, 2004 10:25 pm

Ignoring the end of my subroutines

Post by Robertbob » Wed Dec 22, 2004 10:36 pm

Hi

Firstly - great product - I bought it years ago and have just rediscovered and upgraded...I'm hooked!


Probably a newbie problem...
My script has a long list of subroutines to be executed one after the other:

gosub>get-it
gosub>paste-it
GetClipBoard>End_text
Gosub>search
gosub>select_all
gosub>paste_to_tp
gosub>how_many_matches
gosub>user_choose_link
gosub>select_all
gosub>paste_to_tp
gosub>strip_out_text

It runs perfectly until it gets to the end of the subroutine how_many_matches, at which point is simply ignores the end>how_many_matches and runs straight on to the end of the program (skipping over everything below since everything else begins srt>

Is there a limit to the number of consecutive subroutines I can run?

The problem subroutine begins and ends like this:

srt>how_many_matches
Press CTRL
Wait>0.1
Press Home
Wait>0.1
Release CTRL
...
wait>%shortwait%
press alt
wait>%shortwait%
send>f
wait>%shortwait%
release alt
send>c
wait>%shortwait%
end>how_many_matches

goto>oy_dh


I have put the goto in as a debugger and it definitely jumps straight to the goto - ie it skips straight over the end> statement instead of jumping back to the next gosub> statement.

Any thoughts?

Thanks

Robert

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Post by Captive » Wed Dec 22, 2004 10:56 pm

A common cause for some oddities like this are spaces at the end of the line. For example, the SRT may be called "how_many_matches " with a space a the end, or the "End>" may have a space at the end.

This could mean the SRT and End don't have the same label and aren't paired up.

In the editor, there is a drop down menu "Edit -> Remove trailing spaces"... very handy.

Note that the extra space may be and your "End>paste_to_tp " too. (or instead of)

Robertbob
Newbie
Posts: 2
Joined: Wed Dec 22, 2004 10:25 pm

Post by Robertbob » Wed Dec 22, 2004 11:33 pm

Thanks for the quick response!

I tried the trailing spaces and it didn't change anything - I'll keep tinkering - but thanks anyway.

By the way I do have a trailing space elsewhere in the script (sending a search expression to a "find" dialog box). That works fine, but could the existence of a trailing space in a different subroutine be a problem? (ie are trailing spaces a no-no even when you actually want a trailing space?)

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Thu Dec 23, 2004 12:08 am

The limitation on number of subroutine allowed per .scp file isn't documented, but I would imagine it should support hundreds of subroutines.
Are you sure the control has reached wait>%shortwait% in your srt>>how_many_matches?

For testing purpose, please try:
srt>how_many_matches
Press CTRL
Wait>0.1
Press Home
Wait>0.1
Release CTRL
...
wait>%shortwait%
press alt
wait>%shortwait%
send>f
wait>%shortwait%
release alt
send>c
wait>%shortwait%
end>how_many_matches
Msg>Abnormal Exit
Wait>5

Do you see the "Abnormal Exit" message?

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

Post by support » Thu Dec 23, 2004 8:23 am

Robert,

In order to determine what is causing this problem we would need to see the entire script. Can you send it to [email protected] as a file attachment (.scp file) and we will check it out.

There is no limit to the number of subroutines.
MJT Net Support
[email protected]

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