home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d9xx
/
d929
/
megad.lha
/
MegaD
/
rexx
/
OpenSE.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-07
|
2KB
|
52 lines
/* Open file from Arguments */
/* this is an example of how to modify 'Parse.rexx'
to perform a more useful task, it will open files to the SAS/C editor.
I call this from an ARexx Program Control. The Program Control has the
following items checked.
Skip selected directories
Work without selected items
Skip .info files
Combine all selected on one line
Workbench screen to front at start
*/
IF ~SHOW("L","rexxsupport.library") THEN CALL ADDLIB"rexxsupport.library",0,-30
OPTIONS RESULTS
/******************************************************************/
/* set specific for the program that we will use this script with */
/******************************************************************/
open_command = 'OW'
port_name = 'SC_SE'
program_name = '"SC:C/SE"'
arguments = ARG(1)
/* if no arguments were sent test for the port and if it is
not available run the program without an argument */
if arguments = "" then do
if ~show("P",port_name) then do
ADDRESS COMMAND 'run ' || program_name
END
EXIT
END
DO WHILE arguments ~= ""
/* test for quote at first of name */
/* if it starts with a Quote it ends with a Quote */
delim = " " /* default to space as a delimiter */
IF LEFT(arguments,1) = '"' THEN delim = '"'
ELSE arguments = " " || arguments /* add space to front */
PARSE VAR arguments (delim) filename (delim) arguments
filename = STRIP(filename)
arguments = STRIP(arguments,L)
if ~show("P",port_name) then do
ADDRESS COMMAND 'run ' || program_name || ' ' || filename
ADDRESS COMMAND 'WaitForPort ' || port_name
END
else do
ADDRESS (port_name)
open_command filename || d2c(13) /* return character require for SE */
END
END