FILE
Command:
FILE
command is used to perform I/O on a file from a macro.
nM> FILE <func> <label> ...
FILE
command can manipulate any of the file types for which there is
a file handler, not just Midas Blue files.
nM> file open tag airports.csv{headerrows=1} nM> invoke ,, tag.getDataTable(42) Invoke: ANSWER = {AIRPORT_NAME="Avalon",CODE="AVL", LATITUDE="-038.04083",LONGITUDE="144.46806"} nM> file close tag(Note that
tag
can be any results parameter name, this is
just a simple example.)
OPEN
the file, READ
from it or
WRITE
to it, then close it. (OPEN/N
can be used to
create a new file.)
nM> file open/d/n tag my_really_long_file_name{sr=(LAT/SD,LON/SD)} nM> res tag.data(0,"LAT") 77.7 nM> res tag.data(0,"LON") 99.9 nM> file close tag
OPEN
and CLOSE
, the file is in memory and
can be altered quickly.
FILE
command has many other functions not outlined here
(COPY
, DETACH
, NAME
, RENAME
, PROTECT
,
SAVE
, etc.).
See the explain file for FILE
for details.X-Midas Users Take Note: |
---|
![]() PROTECT and UNPROTECT functions in FILE are
used in place of the X-Midas PROTECT and UNPROTECT commands.
The DETACH function in FILE is used in place of the X-Midas
DETACH command (since NeXtMidas 2.9.1.)
The OPEN and CLOSE functions work similar to the X-Midas
ENV FILE OPEN command.
|