Subroutine/Label XXX Not Found!

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
fightcancer
Macro Veteran
Posts: 257
Joined: Fri Apr 15, 2005 8:32 am

Subroutine/Label XXX Not Found!

Post by fightcancer » Mon Oct 20, 2008 2:16 am

What's causing this error please?
Line: 13 Error - Subroutine/Label InitVars Not Found!
Here's some of my code (w/line numbers on the left).

Code: Select all

13 GoSub>InitVars

410 // Initialize the variables.
411 SRT>InitVars

438 END>InitVars
I get the error as soon as I run the macro. Not sure why. I've been running this macro for weeks.

fightcancer
Macro Veteran
Posts: 257
Joined: Fri Apr 15, 2005 8:32 am

Post by fightcancer » Mon Oct 20, 2008 2:37 am

Ok....

Line 369 was the culprit.

Code: Select all

*/      //  ...
Apparently I can't have those 2 on the same line. I broke them up and it works again.

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Oct 20, 2008 5:09 am

fightcancer wrote:Line 369 was the culprit.

Code: Select all

*/      //  ...
Apparently I can't have those 2 on the same line. I broke them up and it works again.
Hi Marcus,

Can you reproduce this effect? If so... I take it this is unintended?
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Oct 20, 2008 8:18 am

The issue is that the comment parser expects to see the end of the comment block on its own. E.g. it is looking for a line with only "*/". Since it doesn't find that everything after it is effectively commented out, since the comment block hasn't been closed.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Wed Aug 11, 2010 5:26 pm

I am getting this error for compiled scripts under v11.

I can't find any comments like the known problem:

Code: Select all

/* // single line comment within a comment start block not allowed
But I do have:

Code: Select all

/*
// comment
// comment
(code)
*/
and

Code: Select all

/*
' vb comment
' vb comment
*/
Are these commenting OK?
Do I look in the main script or the Included script?

I also set some variables and do a ChangeDir prior to the Include statement so the Include file will be found.

Thanks,

Gale

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Aug 11, 2010 5:54 pm

Those commenting styles look OK to me...

If you posted your error msg text and code, maybe someone here could help.

Take care
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

gdyvig
Automation Wizard
Posts: 447
Joined: Fri Jun 27, 2008 7:57 pm
Location: Seattle, WA

Post by gdyvig » Wed Aug 11, 2010 8:35 pm

I think I figured it out.

This is valid for uncompiled scripts only:

Code: Select all

ChangeDirectory>%parmDir%
Include>parm.scp

ChangeDirectory>c:\mjt
Include>mjtlib.scp

ChangeDirectory>%SCRIPT_DIR%


When compiling a macro, your script must look like this:

Code: Select all

Include>c:\parms\parm.scp
Include>c:\mjtlib\mjtlib.scp
Or move all your include files into SCRIPT_DIR and your script will look like:

Code: Select all


Include>parm.scp
Include>mjtlib.scp


The problem was the compiler could not find my include files but displays no error messages. The error messages display when you run the compiled script.


Gale

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Wed Aug 11, 2010 8:45 pm

gdyvig wrote:The problem was the compiler could not find my include files but displays no error messages. The error messages display when you run the compiled script.
Marcus can you reproduce this? If so maybe error messages could be produced?

The Help File entry for Include> does not specify that the full path should be used however the entry for Macro> does have this line:
Help File entry for Macro> wrote:It is advisable to specify the full path should the path of the script file differ from the current path or change during the execution of the calling macro.
The above line might be helpful in the Include> entry as well.

Glad you figured it out Gale... take care.
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

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