Anonymous user
Readline interface: Difference between revisions
→{{header|REXX}}: reduced the size of the program, added more commands. -- ~~~~
(→{{header|REXX}}: fixed a few bugs, added a "user" command. -- ~~~~) |
(→{{header|REXX}}: reduced the size of the program, added more commands. -- ~~~~) |
||
Line 147:
trace off /*suppress echoing of non-zero RC*/
signal on syntax; signal on novalue /*handle REXX program errors. */
cmds='?|Help|MANual CALendar DIR ECHO
'LLL MEM MORE PROMPT Quit REMark Rexx REDO Type VER'
cmdX='CAL DIR ECHO FC FIND KEDIT LLL MEM MORE REM REXX TYPE VER'
cls='CLS' /*define the pgm to clear screen.*/
@hist.='*** command not defined. ***' /*initialize the history database*/
Line 153 ⟶ 155:
prompt='Enter command ──or── ? ──or── Quit' /*default PROMPT msg.*/
sw=linesize() /*some REXX don't have this BIF. */
redoing=0 /*flag for executing naked ReDO.*/
do forever
call prompter; if xxx=='' then iterate
select /*now then, let's rock & roll. */
when wordpos(xxxF,cmdX)\==
when xxxF=='
when xxxF=='
when xxxF=='
when xxxF=='
when xxxF=='
when xxxF=='LLL' then call .lll▼
end /*select*/
end /*forever*/
Line 186 ⟶ 181:
condition('D'),'REXX source statement (line' sigl"):",,
sourceline(sigl)
/*──────────────────────────────────.
.
/*──────────────────────────────────.HELP subroutine────────────────────*/
.help: say center(strip(xxx yyy),sw-1,'═'); cmds_=cmds
cmdsH='CLS DIR ECHO FC FIND MEM MORE REM TYPE VER'
help. = ' No help is available for the' yyy "command."
help.cal = 'shows a calendar for the current month or specified month.'
Line 223 ⟶ 212:
end
return
/*──────────────────────────────────.
.
/*──────────────────────────────────PROMPTER subroutine─────────────────*/
prompter: if redoing then do /*special case for naked REDO */
Line 242 ⟶ 229:
xxxF=unAbbrev(xxx) /*expand the abbreviation (maybe)*/
return
/*──────────────────────────────────.redo subroutine────────────────────*/
.redo:
Line 257 ⟶ 242:
@hist.yyy
return
/*──────────────────────────────────UNABBREV subroutine─────────────────*/
unabbrev: procedure; arg ccc
Line 266 ⟶ 247:
when abbrev('CALENDAR',ccc,3) then return 'CAL'
when abbrev('CLEARSCREEN',ccc,5) then return 'CLS'
when abbrev('FILECOMPARE',ccc,9) then return '
when abbrev('HISTORY',ccc,4) then return 'HISTORY'
when abbrev('HELP',ccc,1) |,
abbrev('MANUAL',ccc,3) |,
ccc=='?' then return 'HELP'
when abbrev('KEDIT',ccc,1) then return 'KEDIT'
when abbrev('QUIT',ccc,1) then return 'QUIT'
when abbrev('REXX',ccc,1) then return 'REXX'
when abbrev('TYPE',ccc,1) then return 'TYPE'
|