GAMS Data Exchange API
GAMS Data Exchange API
GAMS Data Exchange API
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
TGXFileObj<br />
Page 42<br />
TGXFileObj.gdx<strong>Data</strong>ReadStr<br />
Read the next record in string mode<br />
function gdx<strong>Data</strong>ReadStr(var KeyStr: TgdxStrIndex; var Values: TgdxValues; var DimFrst:<br />
integer): integer;<br />
Parameters<br />
var KeyStr: TgdxStrIndex<br />
The index of the record as strings for the unique elements<br />
var Values: TgdxValues<br />
The data of the record<br />
var DimFrst: integer<br />
The first index position in KeyStr that changed<br />
Return Value<br />
Non-zero if the operation is possible; return zero if the operation is not possible or if there is no more data<br />
Description<br />
Read the next record using strings for the unique elements. The reading should be initialized by calling <strong>Data</strong>ReadStrStart<br />
See Also<br />
TGXFileObj.gdx<strong>Data</strong>ReadStrStart ( see page 42), TGXFileObj.gdx<strong>Data</strong>ReadDone ( see page 38)<br />
TGXFileObj.gdx<strong>Data</strong>ReadStrStart<br />
Initialize the reading of a symbol in string mode<br />
function gdx<strong>Data</strong>ReadStrStart(SyNr: integer; var NrRecs: integer): integer;<br />
Parameters<br />
SyNr: integer<br />
The index number of the symbol, range 0..NrSymbols; SyNr = 0 reads universe<br />
var NrRecs: integer<br />
The number of records available for reading<br />
Return Value<br />
Non-zero if the operation is possible, zero otherwise<br />
Description<br />
Reading data using strings is the simplest way to read data. Every record read using <strong>Data</strong>ReadStr will return the strings for the<br />
unique elements. Internal mapping is not affected by this function.<br />
See Also<br />
TGXFileObj.gdx<strong>Data</strong>ReadStr ( see page 42), TGXFileObj.gdx<strong>Data</strong>ReadRawStart ( see page 40),<br />
TGXFileObj.gdx<strong>Data</strong>ReadMapStart ( see page 39), TGXFileObj.gdx<strong>Data</strong>ReadDone ( see page 38)<br />
Examples<br />
Example<br />
if <strong>Data</strong>ReadStrStart(PGX,1,NrRecs)<br />
then<br />
begin<br />
while <strong>Data</strong>ReadStr(PGX,Uels,Vals)<br />
do [...]<br />
<strong>Data</strong>ReadDone(PGX)<br />
Symbol Reference Classes <strong>GAMS</strong> <strong>Data</strong> <strong>Exchange</strong> <strong>API</strong><br />
2.1<br />
Page 42 2.4<br />
12/3/2012