Decision tables: Difference between revisions

m
→‎{{header|REXX}}: added support for superfluous blanks in answer. -- ~~~~
(→‎{{header|REXX}}: rewrote the REXX program for more positive logic (as opposed to negative logice), corrected a misspelling. -- ~~~~)
m (→‎{{header|REXX}}: added support for superfluous blanks in answer. -- ~~~~)
Line 801:
* used a minimalistic way in expressing the decision table
* extra prompting when there was a user reponse error
* handles superfluous blanks and some punctuation.
* displaying of a countdown so user knows length of interrogation
* visual fidelity aids for postmortem analysis (as in logs)
Line 849 ⟶ 850:
if oops then do; say; say right(howTo,79); say; oops=0; end
say Qprefix Q.?; parse pull x /*ask a question (after a prompt)*/
x=strip(space(x),,'.'); parse upper var x u 1 u1 2 /*u=upper(x); u1=1st char*/
if words(x)==0 then iterate /*nothing entered? Try again. */
if abbrev('QUIT',u,1) then exit /*the user is tired of answering.*/
if (abbrev('YES',u) | abbrev('NO',u)) & words(x)==1 then return u1
say 'invalid response: ' x; oops=1
Line 861 ⟶ 862:
 
───────── (question 1 of 3) Does the printer not print?
no
n
───────── (question 2 of 3) Is there a red light flashing on the printer?
No
n
───────── (question 3 of 3) Is the printer unrecognized by the software?
n
Line 875 ⟶ 876:
n
───────── (question 3 of 3) Is the printer unrecognized by the software?
yes
y
 
Ensure printer software is installed.
Line 883 ⟶ 884:
n
───────── (question 2 of 3) Is there a red light flashing on the printer?
Ye
y
───────── (question 3 of 3) Is the printer unrecognized by the software?
n
Line 893 ⟶ 894:
n
───────── (question 2 of 3) Is there a red light flashing on the printer?
yes.
───────── (question 3 of 3) Is the printer unrecognized by the software?
yes
 
Ensure printer software is installed.