-
Notifications
You must be signed in to change notification settings - Fork 2
_get
bergsma edited this page Sep 26, 2014
·
3 revisions
#get
###Get data from stdin.
Syntax
result = get prompt ;
Arguments
- str prompt
the prompt (echoed to stdout).
Return Value
list result
- list : A list of values, appropriately typecast, read from stdin. Values are delimited by white space characters
The STATUS variable is set to $ACKNOWLEDGE
- NULLString : At the end of file, the result is "".
The STATUS variable is set to %EOF
Warnings
- %EOF : At the end of file, the result is "".
Exceptions
- %ARGUMENT: Invalid arguments. Usage: result = get prompt ;
Description
- None
Examples
list values = get ( "Enter values, separated by spaces" ) ;
str line = gets ( "Enter string value" ) ;
handle h = fopen ( "test.dat", "w" ) ;
fput ( { 1, 2, "three", 4.5 }, h ) ;
fclose ( h ) ;
fopen ( "test.dat", "r" ) ;
str a = fgets ( h ) ; /* a contains "1 2 "three" 4.5" */
fclose ( h ) ;
handle h = fopen ( "test.dat", "w" ) ;
fput ( { 1, 2, "three", 4.5 }, h ) ;
fclose ( h ) ;
fopen ( "test.dat", "r" ) ;
list a = fget ( h ) ; /* a contains { 1, 2, "three", 4.5 } */
fclose ( h ) ;
Related Links
None