home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
vxtech07.zip
/
RXAWAR
/
FUNCS
/
C
/
RUNMACRO.C
< prev
Wrap
C/C++ Source or Header
|
1994-07-16
|
735b
|
36 lines
/*
* runmacro.c -- Runs a rexx macro.
*/
#include <os2.h>
#include <rexxsaa.h>
BOOL RunMacro( PSZ filename, PCH argstring, ULONG len )
{
char buf[ 256 ];
RXSTRING arglist[1];
APIRET rc;
RXSTRING result;
SHORT retcode;
ULONG numargs = 1;
result.strptr = buf;
result.strlength = 256;
arglist[0].strlength = len;
arglist[0].strptr = argstring;
if( len == 0 && argstring == NULL ){
numargs = 0;
}
rc = RexxStart( numargs, arglist, filename, NULL, "CMD", RXCOMMAND,
NULL, &retcode, &result );
if( result.strptr != buf ){
DosFreeMem( result.strptr );
}
return( rc == 0 );
}