User input/Graphical: Difference between revisions

Content added Content deleted
m (→‎{{header|Perl}}: XUL is no longer supported by Mozilla)
m (→‎{{header|REXX}}: changed comments and whitespace, simplified the code.)
Line 1,430: Line 1,430:
it verifies that the correct number has been entered.
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.*/
<lang rexx>/*REXX pgm prompts (using the OS GUI) for a string & then prompts for a specific number.*/
#= 75000 /*the number that must be entered. */
#= 75000 /*the number that must be entered. */
x=
string=
N=
nubber=
do while string=' ' /*string can't be blanks or null string*/
do while x=' '; say /*string can't be blanks or null string*/
say
say 'Please enter a string: '
parse pull x
say 'Please enter a string: '
parse pull string
if x='' then say '***error*** No string entered.'
end /*while x···*/
if string='' then say '***error*** No string entered.'
end /*while string···*/


do while number\=# /*the number (belwow) may be ill formed*/
do while N\=#; say /*the number (below) may be ill formed.*/
say
say 'Please enter the number:' #
parse pull N
say 'Please enter the number:' #
parse pull number
if datatype(N, 'N') then N= N / 1 /*normalize the number: 007 4.0 +2 */
if datatype(number, 'N') then number= number / 1 /*normalize number*/
if N\=# then say '***error*** The number is not correct: ' N.
end /*while N···*/
if number\=# then say '***error*** The number is not correct: ' number
say
end /*while number···*/
say /* [↓] echo values (string & number).*/
say 'The string entered is:' x /*echo the values (string and number. */
say 'The string entered is:' string
say 'The number entered is:' 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}}==
=={{header|Ring}}==