User input/Graphical: Difference between revisions
Content added Content deleted
(Added BBC BASIC) |
(Added Delphi example) |
||
Line 346: | Line 346: | ||
:value-function 'string/integer-prompt-value |
:value-function 'string/integer-prompt-value |
||
:ok-check #'(lambda (result) (eql (cdr result) 75000))))</lang> |
:ok-check #'(lambda (result) (eql (cdr result) 75000))))</lang> |
||
=={{header|Delphi}}== |
|||
<lang Delphi>program UserInputGraphical; |
|||
{$APPTYPE CONSOLE} |
|||
uses |
|||
SysUtils, Dialogs; |
|||
var |
|||
s: string; |
|||
lStringValue: string; |
|||
lIntegerValue: Integer; |
|||
begin |
|||
lStringValue := InputBox('User input/Graphical', 'Enter a string', ''); |
|||
repeat |
|||
s := InputBox('User input/Graphical', 'Enter a string', '75000'); |
|||
lIntegerValue := StrToIntDef(s, 0); |
|||
if lIntegerValue <> 75000 then |
|||
ShowMessage('Invalid entry: ' + s); |
|||
until lIntegerValue = 75000; |
|||
end.</lang> |
|||
=={{header|Haskell}}== |
=={{header|Haskell}}== |