Difference between revisions of "FILE OPEN"

From Macros Wiki
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Command|syntax=FILE_OPEN <filename>, <file Number>, [<type>]
+
[[:Category:External_File_Handling|{{Up}}]]
|description=*DESCRPTION*
 
  
|param1=<filename>|param1_desc={{filename}}
+
{{Command|syntax=FILE_OPEN <file Number>, <filename>, [<action>]
|param2=<file Number>|param2_desc={{file Number}}
+
|description=:Open a text file.
|param3=[<type>]|param3_desc={{type}}
+
 
 +
|param1=<file Number>|param2_desc={{file Number}}
 +
|param2=<filename>|param1_desc={{filename}}
 +
|param3=[<action>]|param3_desc=The file action may be READ, WRITE or APPEND.<br>
 +
:A file opened for READ must already exist.
 +
:A file opened for WRITE will be created, if it does not exist, or overwritten (without warning) if it already exists.
 +
:A file opened for APPEND will be created, if it does not exist. If it does exist, it is opened and the file pointer is moved to the end of file so that output is appended to the end of the file.
 
}}
 
}}
  

Latest revision as of 18:52, 26 June 2018

Up

Command

FILE_OPEN <file Number>, <filename>, [<action>]


Open a text file.

Parameters

<file Number>
Filename as either text in double quotes, or a text variable.
If the filename does not contain full path information, then the file will be opened in the same folder as the macro.
<filename>
File number, 1 to 10. You may have up to 10 files open at the same time.
[<action>]
The file action may be READ, WRITE or APPEND.
A file opened for READ must already exist.
A file opened for WRITE will be created, if it does not exist, or overwritten (without warning) if it already exists.
A file opened for APPEND will be created, if it does not exist. If it does exist, it is opened and the file pointer is moved to the end of file so that output is appended to the end of the file.

Example

FILE_OPEN
For an example macro see Get_Op_Tool_Path Global_Local Print_Geo_Data_To_File