Run Compile macro via a macro

Get help with installation and running Multi-Edit here. Bug reports can be posted here but please not post feature requests here.

Moderator: Moderators

Run Compile macro via a macro

Postby MewUser on Sun Apr 15, 2012 2:13 am

I have two *.s files that I use to run macros, meaning that some of the functions that are used on one macro are defined in another.
When I start MEW 2008 on Windows 7 64 bit, the second macro compile is not present. Apparently, When I compile my second macro, it is only good while MEW is running.

So, I am attempting to create a macro that will view the second macro(it is always open) and RM('Compile'), which gets me to the compile window, but then, how do I tell MEW macro that I want to hit the enter key to actually perform the Select button on the compile window? I have tried CR, but this creates a blank line in my macro!

Thank you for any suggestions.
MewUser
Registered User
 
Posts: 162
Joined: Wed Aug 13, 2003 9:12 pm

Re: Run Compile macro via a macro

Postby Clay Martin MWI on Mon Apr 16, 2012 1:13 pm

Hi,
The problem is that the second macro file is not loaded into memory. There are three ways to attack this. The easiest is in your references to functions in the second mac file from the first, you need a complete reference to the function when you call it. So instead of (assuming abc is the function) RM("abc") you need to use RM("secondfile^abc"). Another solution is to prototype the functions from the second file in a .sh file and #include that in the first .s file. Another would be to load both mac files into memory in your startup2.s file.

When you compile a macro it is loaded into memory, but is not loaded when you restart Multi-Edit, until you call a macro from the file or recompile. If you use a complete reference, eg. file^macroname, all the macros in that file are loaded into memory.

The following post may help you decide how you want to go.
viewtopic.php?f=9&t=2189&p=8044&hilit=startup2#p8044

Thanks,
Clay
Martin Works Inc
www.martinworks.com
Makers of EZRTools
A MEW Add-on package
for programming in SAS
www.ezrtools.com
User avatar
Clay Martin MWI
Registered User
 
Posts: 712
Joined: Tue Jul 29, 2003 1:02 pm
Location: Susquehanna, PA


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 3 guests

cron