User input/Text: Difference between revisions
Content added Content deleted
(Added FreeBASIC) |
(Added XLISP) |
||
Line 1,652: | Line 1,652: | ||
Console.WriteLine("Enter a String") |
Console.WriteLine("Enter a String") |
||
i = Console.ReadLine()</lang> |
i = Console.ReadLine()</lang> |
||
=={{header|XLISP}}== |
|||
<tt>READ-LINE</tt> reads a line of input as a string; <tt>READ</tt> reads an expression, of arbitrary complexity. |
|||
<lang scheme>(display "Enter a string: ") |
|||
(define s (read-line)) |
|||
(display "Yes, ") |
|||
(write s) |
|||
(display " is a string.") ;; no need to verify, because READ-LINE has to return a string |
|||
(newline) |
|||
(display "Now enter the integer 75000: ") |
|||
(define n (read)) |
|||
(display |
|||
(cond |
|||
((not (integerp n)) |
|||
"That's not even an integer." ) |
|||
((/= n 75000) |
|||
"That is not the integer 75000." ) |
|||
(t |
|||
"Yes, that is the integer 75000." ) ) )</lang> |
|||
{{out}} |
|||
<pre>Enter a string: Rosetta Code |
|||
Yes, "Rosetta Code" is a string. |
|||
Now enter the integer 75000: 75000 |
|||
Yes, that is the integer 75000.</pre> |
|||
=={{header|XPL0}}== |
=={{header|XPL0}}== |