Readline interface: Difference between revisions

→‎{{header|REXX}}: added the '''changestr''' bif. -- ~~~~
m (→‎{{header|REXX}}: added VER output to '''output'''. -- ~~~~)
(→‎{{header|REXX}}: added the '''changestr''' bif. -- ~~~~)
Line 144:
<br>The HELP (?), REDO, error checking, and abbreviations took up most of the program.
<br>"User" commands (subroutines) are identified with a leading period (.) to make it easier to understand what's what.
<br><br>Some older REXXes don't have a '''changestr'' bif, so one is included here.
<lang rexx>/*REXX program to implement a simple "readline" *hell. */
trace off /*suppress echoing of non-zero RC*/
Line 180 ⟶ 181:
condition('D'),'REXX source statement (line' sigl"):",,
sourceline(sigl)
/*───────────────────────────CHANGESTR subroutine───────────────────────*/
changestr: procedure; parse arg o,h,n; r=; w=length(o); if w==0 then return n||h
do forever; parse var h y (o) _ +(w) h; if _=='' then return r||y; r=r||y||n; end
/*──────────────────────────────────.CMDX subroutine────────────────────*/
.cmdX: xxxF yyy; return