First time here?
Back again?


 
 

How can I launch an external program with parameters from the post?

CATEGORY: PROGRAMMING
TYPE: MACRO
IMS VERSION: ALL
PLATFORM: ALL

You should use the IMSpost macro command RUN to execute the specified program.
If you need to run a program that uses an IMSpost variable as an argument, you should do this in two steps.
First, create the string to pass to the RUN command, and second, execute the command string.
For example, in Windows, say you want to run Notepad on a filename stored in a variable called GLOBAL.FNAME.
The following macro statements will do this:
MYSTR = "notepad " + GLOBAL.FNAME
RUN(MYSTR)
***** Please note:
notepad is followed by a space inside the double-quote marks.
*****
***** Please note:
The executable program should be in your path, or the path to it must be added to MYSTR, but then it cannot include any spaces.
*****

Back to Frequently Asked Questions