home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 3
/
Merciful_Release_3.bin
/
software
/
b
/
blacksedv1.0.lha
/
BED
/
Rexx
/
CmdShell.bed
< prev
next >
Wrap
Text File
|
1996-01-28
|
1KB
|
81 lines
/*
** $VER: CmdShell.bed 1.0 (02.01.96)
**
** Run the BED command shell
*/
OPTIONS RESULTS
OPTIONS FAILAT 100
OPTIONS PROMPT "BED> "
SAY
SAY ' Enter a BED command or:'
SAY ' - Help <command>'
SAY ' - GetTemplate <command>'
SAY
DO FOREVER
PARSE PULL cmdString
SELECT
WHEN (cmdString = "") | (UPPER(cmdString) = "Q") | (UPPER(cmdString) = "QUIT") THEN DO
LEAVE
END
WHEN (cmdString = "?") THEN DO
SAY 'Enter "Help <command>" to obtain a command''s help'
SAY 'Enter "GetTemplate <command>" to obtain the command''s template'
SAY 'Enter CTRL-\ to close this window.'
END;
OTHERWISE DO
CALL HandleCmd(cmdString)
END;
END
END
RETURN
HandleCmd: PROCEDURE
PARSE ARG cmdString
cmdString
IF RC = 0 THEN DO
IF symbol('RESULT') == "VAR" THEN DO
SAY RESULT
END
RETURN
END;
IF BED.LASTERROR = 29 THEN DO
ADDRESS REXX cmdString
IF RC > 0 THEN DO
ADDRESS COMMAND cmdString
END
END
IF RC > 0 THEN DO
last = BED.LASTERROR
special = BED.SPECIALERROR
GetErrorInfo last
SAY '*** General Error #'last'; 'RESULT
IF special ~= 0 THEN DO
IF last = 36 THEN
msg = ERRORTEXT(special)
ELSE DO
GetErrorInfo last special
msg = RESULT
END
SAY '*** Special Error #'special'; 'msg
END
END
RETURN