PML Customisation
User Guide
Handling Files and Directories
:
Creating a File Object
: Example
Example
This example reads pairs of numbers from file data, adds them together and writes the answers to file
RESULTS
.
!Input = object FILE('DATA')
!Input.Open(‘READ’)
!Output = object FILE('RESULTS')
!Output.Open(‘WRITE’)
do
!Line = !Input.ReadRecord()
if (!Line.set()) then
!array = !Line.Split()
!Total = !Array[1].Real() + !Array[2].Real()
!Output.WriteRecord( !Total.String() )
else
break
endif
enddo
!Output.Close()
!Input.Close()
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.