Lets you read a text file.
Arguments
IsEndOfFile Name | Input / Output | Required? | Type | Comment |
Format | In | Yes | String | |
Parameters | In | No | ObjectType | |
Example 1
let file (TextFile)
let buffer (String)
set file = OpenTextFile("e:\tmp\TextFile1.txt","r")
set buffer = file->Read()
Example 2
let parms (List)
parms.Append(' Representation316411704 --- IN_WORK\Integer.1' )
parms.Append(' Representation316411704 --- IN_WORK\Real.1' )
parms.Append(' Representation316411704 --- IN_WORK\Length.1' )
set file = OpenTextFile("e:\tmp\TextFile1.txt","w")
format = "Integer = # Real = # Length = #"
buffer = file->Read(format,parms)
The result is the following:
buffer = "Integer = 5 Real = 10.23 Length = 22mm"
The function also modifies the parameters depending on the text file content. If no parameter exists (ex: Integer.1), it is not created and a warning message appears.