User input/Text: Difference between revisions

Content added Content deleted
(Fixed to most recent version)
m (→‎{{header|REXX}}: added more wording to the REXX section header, added/changed comments and whitespace.)
Line 1,421: Line 1,421:


=={{header|REXX}}==
=={{header|REXX}}==
Note: 7.5e4 or 75e3 are also accepted as 75000!
Note:   all of the following would be accepted as being numerically equal to   '''75000''':
:*   '''7.5E+0004'''
<lang rexx>/*REXX pgm prompts and gets a string and also the # 75000 from terminal.*/
:* &nbsp; '''75000.'''
say 'Please enter a string:'; parse pull userString
:* &nbsp; '''750000e-01'''
say 'You entered this string:' userString /* show it on the console */
;* &nbsp; '''000075000.0000'''
/* [↑] string can be any length.*/
:* &nbsp; &nbsp; &nbsp; ''' 75000 ''' &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (with leading and/or trailing blanks)
do until userNumber=75000 /*repeat this loop until correct.*/
:* &nbsp; and others
say /*display blank line to terminal.*/

say 'Please enter the number 75000' /*display a nice prompt message. */
If the intent was to have the user enter the string exactly as &nbsp; '''75000''',
parse pull userNumber /*obtain the user text from term.*/
<br>then the REXX &nbsp; '''do''' &nbsp; statement should be replaced with:
end /*until ··· */ /*check if the response is legit.*/
do until userNumber==75000
/*stick a fork in it, we're done.*/</lang>

<lang rexx>/*REXX program prompts & reads/obtains a string, and also the number 75000 from terminal*/
say 'Please enter a string:' /*issue a prompt message to the term. */
parse pull userString /*the (char) string can be any length. */
/* [↑] the string could be null/empty.*/
do until userNumber=75000 /*repeat this loop until satisfied. */
say /*display a blank line to the terminal.*/
say 'Please enter the number 75000' /*display a nice prompt message to term*/
parse pull userNumber /*obtain the user text from terminal. */
end /*until*/ /*check if the response is legitimate. */
/*stick a fork in it, we're all done. */</lang>


=={{header|Ring}}==
=={{header|Ring}}==