gets
gets(g_variableName[p_inputPort] ) =>t_string/ nil
Description
Reads a line from the input port and stores the line as a string in the variable. This is a macro.
The string is also returned as the value of gets. The terminating newline character of the line becomes the last character in the string.
Arguments
|
Variable to store input string in. You can also specify |
|
Value Returned
|
When EOF is reached. s_variableName stores the last value returned (that is, |
Examples
Assume the test1.data file has the following first two lines:
#This is the data for test1
0001 1100 1011 0111
p = infile("test1.data") => port:"test1.data"
gets(s p) => "#This is the data for test1\n"
gets(s p)
=> "0001 1100 1011 0111\n"
s
=> "0001 1100 1011 0111\n"
var = gets(nil port) -- read into var from port
var = gets(nil) -- read into var from <stdin>
Related Topics
Return to top