User input/Graphical: Difference between revisions

m
→‎{{header|REXX}}: changed comments and whitespace, simplified the code.
m (→‎{{header|Perl}}: XUL is no longer supported by Mozilla)
m (→‎{{header|REXX}}: changed comments and whitespace, simplified the code.)
Line 1,430:
it verifies that the correct number has been entered.
<lang rexx>/*REXX pgm prompts (using the OS GUI) for a string & then prompts for a specific number.*/
#= 75000 #= 75000 /*the number that must be entered. */
x=
string=
N=
nubber=
do while x=' '; say do while string=' ' /*string can't be blanks or null string*/
say 'Please enter a string: say'
parse pull x
say 'Please enter a string: '
if x='' then say '***error*** No string parse pull stringentered.'
end /*while stringx···*/
if string='' then say '***error*** No string entered.'
end /*while string···*/
 
do while N\=#; say do while number\=# /*the number (belwowbelow) may be ill formed.*/
say 'Please enter the number:' say#
parse pull N
say 'Please enter the number:' #
if datatype(N, 'N') then N= N / 1 parse pull /*normalize the number: 007 4.0 +2 */
if N\=# then if datatype(number,say 'N')***error*** thenThe number= numberis /not 1correct: ' /*normalize number*/N.
end /*while numberN···*/
if number\=# then say '***error*** The number is not correct: ' number
say
end /*while number···*/
say 'The string entered is:' x /*echo [↓] echothe values (string &and number). */
say 'The stringnumber entered is:' string N /*stick a fork in it, we're all done. */</lang><br><br>
say 'The number entered is:' number
/*stick a fork in it, we're all done. */</lang><br><br>
 
=={{header|Ring}}==