Skip to content
bergsma edited this page Sep 26, 2014 · 3 revisions

get

Get data from stdin.

Syntax

result = get prompt ;

Arguments

  1. 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

  • ****:

Exceptions

  • %ARGUMENT: Invalid arguments. Usage: result = get prompt ;

Description

%FILE 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

Clone this wiki locally