diskdata


Purpose
Read in or write an array or set of strings to a file.
Synopsis
procedure diskdata(format:integer, file:string, a:array)
procedure diskdata(format:integer, file:string, s:set of string)
Arguments
format 
Format options:
ETC_DENSE 
dense data format
ETC_SPARSE 
sparse data format
ETC_SGLQ 
strings quoted with single quotes
ETC_NOQ 
strings are not quoted in the file
ETC_OUT 
write to a file
ETC_APPEND 
append output to the end of an existing file
ETC_TRANS 
tables are transposed
ETC_IN 
read from file (default)
ETC_NOZEROS 
skip zero values
Several options may be combined using `+'.
file 
Extended file name
Array with elements of a basic type
Set of strings
Example
The following example declares two sets and two dynamic arrays. The array ar1 is read in from the file in.dat. Then both arrays, ar1 and ar2, are saved to the file out.dat (in sparse format) and finally the contents of the set Set1 is appended to the file out.dat.
declarations
 Set1: set of string 
 R: range 
 ar1,ar2: array(Set1,R) of real
end-declarations

diskdata(ETC_SPARSE, "in.dat", ar1) 
diskdata(ETC_OUT, "out.dat", [ar1, ar2])  
diskdata(ETC_OUT+ETC_APPEND, "out.dat", Set1)
Further information
This procedure reads in data from a file or writes to a file, depending on the parameter settings. The file format used is compatible with the command DISKDATA of the modeler mp-model.


If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.