Compiler work with macro that calls multiple macros?

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
guest22

Compiler work with macro that calls multiple macros?

Post by guest22 » Tue Sep 14, 2004 4:02 am

If I create an .exe file out of a macro that calls other macros how does it handle the other macros. For instance, if I were to distribute the .exe file would I also have to distribute the other .scp files.

thanks

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Sep 14, 2004 6:17 am

:idea: Rather than calling the other macros, consider putting them into the main macro and call them as sub routines. Compile the whole thing as one executable.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

guest22

Post by guest22 » Tue Sep 14, 2004 1:38 pm

Yeah, I've thought about that but then I'd have macros over 1000+ lines long. That seems to make it harder to manage/debug then separate macros with distinct purposes. However, if that is the best workaround I guess I'll give it a go.

adroege
Automation Wizard
Posts: 438
Joined: Tue Dec 07, 2004 7:39 pm

Compiled macros compiles in external called macros as well?

Post by adroege » Wed Mar 09, 2005 3:04 pm

This topic hasn't been addressed in some time now...... Has this capability been added yet? It is not feasible for us to rewrite hundreds of seperate macros into Gosubs. There is also the problem of variable scoping. With external macros being called from the main script, I am free to reuse variable names, as they are kept seperate (local variables). If I try to put them all together as subroutines, then all the variables become global.

Please consider adding this to a future release if it is not already!!

Thanks.
p.s. Wonderful Product!

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed Mar 09, 2005 4:11 pm

Compile them all to .exe's and call them from the main .exe ?

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

Post by support » Wed Mar 09, 2005 6:03 pm

Yes, a compiled macro is just *one* compiled macro. We can't really compile in more than one macro. Not sure if that's possible.

But you can compile all your macros and have each one call the other with Run Program.
MJT Net Support
[email protected]

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

Post by armsys » Thu Mar 10, 2005 3:37 am

Hi Guest22,

Unlike other languages such as Clipper, automatic dependent scripts compiling is not supported by Macro Scheduler.

Like what Support and Me_again suggest, you're better off compile your .scp files individually and run them in your MAIN script. As always, an .EXE runs significantly faster than the pure text version of the script, interpreted line by line by Macro Scheduler.

Perhaps it's a good idea to write a script to compile all scripts automatically to create multiple .EXE files.

multifix
Newbie
Posts: 8
Joined: Mon Mar 28, 2005 4:17 pm
Location: Florida

exe versus scp

Post by multifix » Wed Mar 30, 2005 5:49 pm

Be aware of this:-

Scripts called from a main macro behave like subroutines.i.e. execution continues after the called script is finished. Executables, on the hand, run independently of whatever script or other executable may be running.
Kris

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

Post by support » Wed Mar 30, 2005 7:02 pm

That is only true if RP_WAIT=0. If you set RP_WAIT to 1 the exe will behave like a subroutine as the script will wait until the exe has finished and terminated before it will continue:

Let>RP_WAIT=1
Run>yourexe.exe
MJT Net Support
[email protected]

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