These functions work with files and other I/O tasks.
Anchor append
...
none append append
( string,any,... )
...
Writes output to a file specified by its name or by a filehandler previously assigned to it by the file() function. The output file type depends on the type that is being written - in exactly the same way as it does for the write() function (see below). As the name implies, append() never overwrites previously existing output.
Anchor exist exist
number exist
( string )
This function checks whether a file or directory exists. The single argument is the file or directory name - you must specify the full path . The function returns a number, 1 if the file exists and 0 otherwise. Use it combined with fail() or stop() for error checking :
if (not(exist("/home/xy/xyz/metview/grib_file"))) then
fail("specified input file does not exist!")
end if
(...)
Anchor file
...
filehandler file file
( string )
Assigns a file handler to a file whose name is the function argument. The file handler can be used in place of the file name in file output functions - write() and append() .
Anchor
...
none newpage newpage newpage
( display window )
Forces a new page to be taken in the current PostScript file.
Anchor print
...
none print print
(...)
Prints all its arguments to the output area of the main user interface (and to that of any opened macro editor window).
Anchor read
...
fieldset read read
( string )observations
read
( string )geopoints
read
( string )list
read
( string )netcdf
read
( string )
...
The variable of type list is used to hold the contents of an ASCII file - the elements of this list variable are themselves lists, each holding a line of text. The elements of these sub lists are the text line tokens (component strings) arising from the parsing of the text.
table read_table ( definition ) Anchor read_table read_table
Reads an ASCII table-based file such as a comma separated value (CSV) file. Use the Table Reader icon to construct the input definition for this function.
Anchor tmpfile
...
string tmpfile tmpfile
( )
Reserves and returns a unique file name (inside the Metview cache directory) for a temporary file. Returned filenames are unique even when there are several copies of the same macro being executed simultaneously.
Anchor
...
none write write write
( string,any,... )none
write
( filehandler,any,... )
...