GAMS Data Exchange API (GDX) Documentation

Generated for GAMS 37.1.0

Functions, Procedures, and Properties

 
Boolean gdxStoreDomainSets
 Flag to store one dimensional sets as potential domains, false saves lots of space for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly'
 
Boolean gdxStoreDomainSetsSet
 Flag to store one dimensional sets as potential domains, false saves lots of space for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly.
 
Integer gdxAcronymAdd
 Add a new acronym entry. This can be used to add entries before data is written. =<0 if the entry is not added.
 
Integer gdxAcronymCount
 Number of entries in the acronym table.
 
Integer gdxAcronymGetInfo
 Retrieve acronym information from the acronym table. <>0 if the index into the acronym table is valid.
 
Integer gdxAcronymGetMapping
 Get information how acronym values are remapped. When reading gdx data, we need to map indices for acronyms used in the gdx file to indices used by the reading program. <>0 if the index into the acronym table is valid.
 
Integer gdxAcronymIndex
 Get index value of an acronym. 0 if V does not represent an acronym.
 
Integer gdxAcronymName
 Find the name of an acronym value. <>0 if a name for the acronym is defined. An unnamed acronym value will return a string of the form UnknownAcronymNNN, were NNN is the index of the acronym.
 
Integer gdxAcronymNextNr
 Returns the value of the NextAutoAcronym variable and sets the variable to NV. When we read from a gdx file and encounter an acronym that was not defined, we need to assign a new index for that acronym. That index is the variable NextAutoAcronym.
 
Integer gdxAcronymSetInfo
 Modify acronym information in the acronym table. When reading (writing) a gdx file, this function is used to provide the acronym index (name of an acronym), the SyId (AIndx) parameter must match.
 
Double gdxAcronymValue
 Create an acronym value based on the index (AIndx should be greater than 0). Returns the calculated acronym value (0 if AIndx =<0).
 
Integer gdxAddAlias
 Add an alias for a set to the symbol table. One of the two identifiers has to be a known set, the other identifier is used as the new alias. 0 if the operation is not possible.
 
Integer gdxAddSetText
 Register a string to be used as text associated with a unique element. The string must follow the GAMS syntax rules for explanatory text. 0 if the operation is not possible.
 
Integer gdxAutoConvert
 Returns the value of the AutoConvert variable and sets the variable to NV. If AutoConvert <>0 when closing a new gdx file we look at the GDXCOMPRESS and GDXCONVERT environment variables to determine if conversion to an older file format is desired.
 
Integer gdxClose
 Close a gdx file that was previously opened for reading or writing. Any pending write operations will be finished before closing
 
Integer gdxDataErrorCount
 The number of error records after a write operation is finished (gdxDataWriteDone).
 
Integer gdxDataErrorRecord
 Retrieve an error record. <>0 if the record number is valid.
 
Integer gdxDataErrorRecordX
 Retrieve an error record. <>0 if the record number is valid.
 
Integer gdxDataReadDone
 Finish reading of a symbol in any mode(raw, mapped, string). 0 if the operation is not possible.
 
Integer gdxDataReadFilteredStart
 Initialize the reading of a symbol in filtered mode. 0 if the operation is not possible.
 
Integer gdxDataReadMap
 Read the next record in mapped mode. 0 if the operation is not possible.
 
Integer gdxDataReadMapStart
 Initialize the reading of a symbol in mapped mode. 0 if the operation is not possible.
 
Integer gdxDataReadRaw
 Read the next record in raw mode. 0 if the operation is not possible.
 
Integer gdxDataReadRawFast
 Read a symbol in Raw mode using a callback procedure. 0 if the operation is not possible.
 
Integer gdxDataReadRawFastFilt
 Read a symbol in Raw mode while applying a filter using a callback procedure. 0 if the operation is not possible.
 
Integer gdxDataReadRawStart
 Initialize the reading of a symbol in raw mode. 0 if the operation is not possible.
 
Integer gdxDataReadSlice
 Read a slice of data from a data set, by fixing zero or more index positions in the data. When a data element is available, the callback procedure DP is called with the current index and the values. 0 if the operation is not possible.
 
Integer gdxDataReadSliceStart
 Prepare for the reading of a slice of data from a data set. The actual read of the data is done by calling gdxDataReadSlice. When finished reading, call gdxDataReadDone. 0 if the operation is not possible.
 
Integer gdxDataReadStr
 Read the next record using strings for the unique elements. The reading should be initialized by calling DataReadStrStart. 0 if the operation is not possible or if there is no more data.
 
Integer gdxDataReadStrStart
 Initialize the reading of a symbol in string mode. 0 if the operation is not possible.
 
Integer gdxDataSliceUELS
 Map a slice index into the corresponding unique elements. After calling DataReadSliceStart, index positions are mapped from 0 to N(d)-1. This function maps this index space back into unique elements (strings). 0 if the operation is not possible.
 
Integer gdxDataWriteDone
 Finish a write operation. 0 if the operation is not possible.
 
Integer gdxDataWriteMap
 Write a data element in mapped mode. 0 if the operation is not possible.
 
Integer gdxDataWriteMapStart
 Start writing a new symbol in mapped mode. 0 if the operation is not possible.
 
Integer gdxDataWriteRaw
 Write a data element in raw mode. 0 if the operation is not possible.
 
Integer gdxDataWriteRawStart
 Start writing a new symbol in raw mode. 0 if the operation is not possible.
 
Integer gdxDataWriteStr
 Write a data element in string mode. Each element string must follow the GAMS rules for unique elements. 0 if the operation is not possible.
 
Integer gdxDataWriteStrStart
 Start writing a new symbol in string mode. 0 if the operation is not possible.
 
Integer gdxGetDLLVersion
 Returns a version descriptor of the library. Always nonzero
 
Integer gdxErrorCount
 Total number of errors encountered.
 
Integer gdxErrorStr
 Returns the text for a given error number. Always nonzero.
 
Integer gdxFileInfo
 Returns file format number and compression level used. Always nonzero.
 
Integer gdxFileVersion
 Return strings for file version and file producer. Always nonzero.
 
Integer gdxFilterExists
 Check if there is a filter defined based on its number as used in gdxFilterRegisterStart. 0 if the operation is not possible.
 
Integer gdxFilterRegister
 Add a unique element to the current filter definition. 0 if the index number is out of range or was never mapped into the user index space.
 
Integer gdxFilterRegisterDone
 Finish registration of unique elements for a filter. 0 if the operation is not possible.
 
Integer gdxFilterRegisterStart
 Define a unique element filter. 0 if the operation is not possible.
 
Integer gdxFindSymbol
 Search for a symbol by name (case insensitive). When the symbol is found, SyNr contains the symbol number and the function returns a nonzero, else it returns 0.
 
Integer gdxGetElemText
 Retrieve the string and node number for an entry in the string table. 0 if the operation is not possible.
 
Integer gdxGetLastError
 Returns the last error number or 0 if there was no error. Calling this function will clear the last error stored.
 
Int64 gdxGetMemoryUsed
 Get memory in use by gdx object.
 
Integer gdxGetSpecialValues
 Retrieve the internal values for special values. Always nonzero.
 
Integer gdxGetUEL
 Get the string for a unique element using a mapped index. 0 if the operation is not possible.
 
Integer gdxMapValue
 Classify a value as a potential special value. Nonzero if D is a special value, 0 otherwise.
 
Integer gdxOpenAppend
 Open an existing gdx file for output. Nonzero if the file can be opened, 0 otherwise.
 
Integer gdxOpenRead
 Open an existing gdx file for input. Nonzero if the file can be opened, 0 otherwise.
 
Integer gdxOpenReadEx
 Open an existing gdx file for input allowing for skiping sections. Nonzero if the file can be opened, 0 otherwise.
 
Integer gdxOpenWrite
 Open a new gdx file for output. Nonzero if the file can be opened, 0 otherwise.
 
Integer gdxOpenWriteEx
 Open a new gdx file for output with optional compression. Nonzero if the file can be opened, 0 otherwise.
 
Integer gdxResetSpecialValues
 Reset the internal values for special values. Always nonzero.
 
Integer gdxSetHasText
 Test if any of the unique elements in a set has associated text. Nonzero if the Set contains at least one unique element that has associated text, 0 otherwise
 
Integer gdxSetReadSpecialValues
 Set internal values for special values when reading a gdx file. Before calling this function, initialize the array of special values by calling gdxGetSpecialValues first. Always nonzero
 
Integer gdxSetSpecialValues
 Set internal values for special values. Before calling this function, initialize the array of special values by calling gdxGetSpecialValues first. Note, values in AVals have to be unique. Nonzero if all values specified are unique, 0 otherwise.
 
Integer gdxSetTextNodeNr
 Set the Node number for an entry with Index N in the string table. After registering a string with AddSetText, we can assign a node number for later retrieval. 0 if the operation is not possible.
 
Integer gdxSetTraceLevel
 Set the amount of trace (debug) information generated. Always nonzero.
 
Integer gdxSymbIndxMaxLength
 Returns the length of the longest UEL used for every index position for a given symbol.
 
Integer gdxSymbMaxLength
 Returns the length of the longest symbol name.
 
Integer gdxSymbolAddComment
 Add a line of comment text for a symbol. 0 if the operation is not possible.
 
Integer gdxSymbolGetComment
 Retrieve a line of comment text for a symbol. 0 if the operation is not possible.
 
Integer gdxSymbolGetDomain
 Retrieve the domain of a symbol. 0 if the operation is not possible.
 
Integer gdxSymbolGetDomainX
 Retrieve the domain of a symbol (Relaxed version). 0 if the operation is not possible.
 
Integer gdxSymbolDim
 Retrieve dimension of a symbol.
 
Integer gdxSymbolInfo
 Returns information about a symbol. 0 if the symbol number is out of range, nonzero otherwise.
 
Integer gdxSymbolInfoX
 Returns additional information about a symbol. 0 if the symbol number is out of range, nonzero otherwise.
 
Integer gdxSymbolSetDomain
 Define the domain of the symbol for which a write data operation just started using DataWriteRawStart, DataWriteMapStart or DataWriteStrStart. 0 if the operation is not possible.
 
Integer gdxSymbolSetDomainX
 Define the domain of symbol SyNr (Relaxed version). 0 if the operation is not possible.
 
Integer gdxSystemInfo
 Returns the number of symbols and unique elements. Always nonzero.
 
Integer gdxUELMaxLength
 Returns the length of the longest UEL name.
 
Integer gdxUELRegisterDone
 Finish registration of unique elements. 0 if the operation is not possible.
 
Integer gdxUELRegisterMap
 Register a unique element in mapped mode. A unique element must follow the GAMS rules when it contains quote characters. 0 if the operation is not possible.
 
Integer gdxUELRegisterMapStart
 Start registering unique elements in mapped mode. 0 if the operation is not possible.
 
Integer gdxUELRegisterRaw
 Register a unique element in raw mode. This can only be used while writing to a gdx file. 0 if the operation is not possible.
 
Integer gdxUELRegisterRawStart
 Start registering unique elements in raw mode. 0 if the operation is not possible.
 
Integer gdxUELRegisterStr
 Register a unique element in string mode. A unique element must follow the GAMS rules when it contains quote characters. Nonzero if the element was registered, zero otherwise.
 
Integer gdxUELRegisterStrStart
 Start registering unique elements in string mode. 0 if the operation is not possible.
 
Integer gdxUMFindUEL
 Search for a unique element by its string. Nonzero if the element was found, 0 otherwise.
 
Integer gdxUMUelGet
 Get a unique element using an unmapped index. 0 if the operation is not possible.
 
Integer gdxUMUelInfo
 Returns information about the unique elements. Always nonzero.
 
Integer gdxGetDomainElements
 Get the unique elements for a given dimension of a given symbol.
 
Integer gdxCurrentDim
 Returns the dimension of the current active symbol. When reading or writing data, the dimension of the current active symbol is sometimes needed to convert arguments from strings to pchars etc.
 
Integer gdxRenameUEL
 Rename a previously known unique element.
 

Definitions

gdxStoreDomainSets 

Flag to store one dimensional sets as potential domains, false saves lots of space for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly'

Type
Property of type Boolean
Action
read

gdxStoreDomainSetsSet 

Flag to store one dimensional sets as potential domains, false saves lots of space for large 1-dim sets that are no domains but can create inconsistent GDX files if used incorrectly'

Type
Property of type Boolean
Action
write

gdxAcronymAdd 

Add a new acronym entry. This can be used to add entries before data is written. =<0 if the entry is not added.

Type
Function returns Integer
Parameters
  const  ShortString    AName
     Name of the acronym
  const  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)
   Integer    AIndx
     Index value of the acronym

gdxAcronymCount 

Number of entries in the acronym table.

Type
Function returns Integer

gdxAcronymGetInfo 

Retrieve acronym information from the acronym table. <>0 if the index into the acronym table is valid.

Type
Function returns Integer
Parameters
   Integer    N
     Index number/Tracing level, N=<0 no tracing N>=3 maximum tracing (gdxSetTraceLevel)/Line number (gdxSymbolGetComment)
  out  ShortString    AName
     Name of the acronym
  out  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)
  out  Integer    AIndx
     Index value of the acronym

gdxAcronymGetMapping 

Get information how acronym values are remapped. When reading gdx data, we need to map indices for acronyms used in the gdx file to indices used by the reading program. <>0 if the index into the acronym table is valid.

Type
Function returns Integer
Parameters
   Integer    N
     Index number/Tracing level, N=<0 no tracing N>=3 maximum tracing (gdxSetTraceLevel)/Line number (gdxSymbolGetComment)
  out  Integer    orgIndx
     The Index used in the gdx file
  out  Integer    newIndx
     The Index returned when reading gdx data
  out  Integer    autoIndex
     Nonzero if the newIndx was generated using the value of NextAutoAcronym

gdxAcronymIndex 

Get index value of an acronym. 0 if V does not represent an acronym.

Type
Function returns Integer
Parameters
   Double    V
     Input value, possibly representing an acronym/Version string after return (gdxGetDLLVersion)

gdxAcronymName 

Find the name of an acronym value. <>0 if a name for the acronym is defined. An unnamed acronym value will return a string of the form UnknownAcronymNNN, were NNN is the index of the acronym.

Type
Function returns Integer
Parameters
   Double    V
     Input value, possibly representing an acronym/Version string after return (gdxGetDLLVersion)
  out  ShortString    AName
     Name of the acronym

gdxAcronymNextNr 

Returns the value of the NextAutoAcronym variable and sets the variable to NV. When we read from a gdx file and encounter an acronym that was not defined, we need to assign a new index for that acronym. That index is the variable NextAutoAcronym.

Type
Function returns Integer
Parameters
   Integer    NV
     New value

gdxAcronymSetInfo 

Modify acronym information in the acronym table. When reading (writing) a gdx file, this function is used to provide the acronym index (name of an acronym), the SyId (AIndx) parameter must match.

Type
Function returns Integer
Parameters
   Integer    N
     Index number/Tracing level, N=<0 no tracing N>=3 maximum tracing (gdxSetTraceLevel)/Line number (gdxSymbolGetComment)
  const  ShortString    AName
     Name of the acronym
  const  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)
   Integer    AIndx
     Index value of the acronym

gdxAcronymValue 

Create an acronym value based on the index (AIndx should be greater than 0). Returns the calculated acronym value (0 if AIndx =<0).

Type
Function returns Double
Parameters
   Integer    AIndx
     Index value of the acronym

gdxAddAlias 

Add an alias for a set to the symbol table. One of the two identifiers has to be a known set, the other identifier is used as the new alias. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  ShortString    Id1
     Set identifier
  const  ShortString    Id2
     Set identifier

gdxAddSetText 

Register a string to be used as text associated with a unique element. The string must follow the GAMS syntax rules for explanatory text. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)
  out  Integer    TxtNr
     The index number assigned to this string (gdxAddSetText)/String table index (gdxGetElemText)/Index number of the entry to be modified (gdxSetTextNodeNr)

gdxAutoConvert 

Returns the value of the AutoConvert variable and sets the variable to NV. If AutoConvert <>0 when closing a new gdx file we look at the GDXCOMPRESS and GDXCONVERT environment variables to determine if conversion to an older file format is desired.

Type
Function returns Integer
Parameters
   Integer    NV
     New value

gdxClose 

Close a gdx file that was previously opened for reading or writing. Any pending write operations will be finished before closing

Type
Function returns Integer

gdxCurrentDim 

Returns the dimension of the current active symbol. When reading or writing data, the dimension of the current active symbol is sometimes needed to convert arguments from strings to pchars etc.

Type
Function returns Integer

gdxDataErrorCount 

The number of error records after a write operation is finished (gdxDataWriteDone).

Type
Function returns Integer

gdxDataErrorRecord 

Retrieve an error record. <>0 if the record number is valid.

Type
Function returns Integer
Parameters
   Integer    RecNr
     The number of the record to be retrieved, range from 1 to NrErrorRecords; this argument is ignored in gdxDataReadMap
  var  TgdxUELIndex    KeyInt
     Index of the record/element
  var  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)

gdxDataErrorRecordX 

Retrieve an error record. <>0 if the record number is valid.

Type
Function returns Integer
Parameters
   Integer    RecNr
     The number of the record to be retrieved, range from 1 to NrErrorRecords; this argument is ignored in gdxDataReadMap
  var  TgdxUELIndex    KeyInt
     Index of the record/element
  var  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)

gdxDataReadDone 

Finish reading of a symbol in any mode(raw, mapped, string). 0 if the operation is not possible.

Type
Function returns Integer

gdxDataReadFilteredStart 

Initialize the reading of a symbol in filtered mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  const  TgdxUELIndex    FilterAction
     Array of filter actions for each index position
  out  Integer    NrRecs
     The maximum number of records available for reading. The actual number of records may be less when a filter is applied to the records read.

gdxDataReadMap 

Read the next record in mapped mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    RecNr
     The number of the record to be retrieved, range from 1 to NrErrorRecords; this argument is ignored in gdxDataReadMap
  var  TgdxUELIndex    KeyInt
     Index of the record/element
  var  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)
  out  Integer    DimFrst
     The first index position in KeyInt that changed

gdxDataReadMapStart 

Initialize the reading of a symbol in mapped mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  out  Integer    NrRecs
     The maximum number of records available for reading. The actual number of records may be less when a filter is applied to the records read.

gdxDataReadRaw 

Read the next record in raw mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  var  TgdxUELIndex    KeyInt
     Index of the record/element
  var  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)
  out  Integer    DimFrst
     The first index position in KeyInt that changed

gdxDataReadRawFast 

Read a symbol in Raw mode using a callback procedure. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  TDataStoreProc    DP
    Procedure (const Indx : TgdxUELIndex, const Vals : TgdxValues )
     Callback procedure that will be called for each item
  out  Integer    NrRecs
     The maximum number of records available for reading. The actual number of records may be less when a filter is applied to the records read.

gdxDataReadRawFastFilt 

Read a symbol in Raw mode while applying a filter using a callback procedure. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  const  TgdxStrIndex    UelFilterStr
     Each index can be fixed by setting the string for the unique element. Set an index position to the empty string in order not to fix that position.
  TDataStoreFiltProc    DP
    Function (const Indx : TgdxUELIndex, const Vals : TgdxValues, Uptr : Pointer ) returns Integer
     Callback procedure that will be called for each item

gdxDataReadRawStart 

Initialize the reading of a symbol in raw mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  out  Integer    NrRecs
     The maximum number of records available for reading. The actual number of records may be less when a filter is applied to the records read.

gdxDataReadSlice 

Read a slice of data from a data set, by fixing zero or more index positions in the data. When a data element is available, the callback procedure DP is called with the current index and the values. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  TgdxStrIndex    UelFilterStr
     Each index can be fixed by setting the string for the unique element. Set an index position to the empty string in order not to fix that position.
  out  Integer    Dimen
     Dimension of the symbol/index space; index space means the number of index positions that is not fixed (gdxDataReadSlice)
  TDataStoreProc    DP
    Procedure (const Indx : TgdxUELIndex, const Vals : TgdxValues )
     Callback procedure that will be called for each item

gdxDataReadSliceStart 

Prepare for the reading of a slice of data from a data set. The actual read of the data is done by calling gdxDataReadSlice. When finished reading, call gdxDataReadDone. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  var  TgdxUELIndex    ElemCounts
     Array of integers, each position indicating the number of unique indices in that position

gdxDataReadStr 

Read the next record using strings for the unique elements. The reading should be initialized by calling DataReadStrStart. 0 if the operation is not possible or if there is no more data.

Type
Function returns Integer
Parameters
  out  TgdxStrIndex    KeyStr
     The index of the record or element using strings for the unique elements/Array of strings containing the unique elements (gdxDataSliceUELS)
  var  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)
  out  Integer    DimFrst
     The first index position in KeyInt that changed

gdxDataReadStrStart 

Initialize the reading of a symbol in string mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  out  Integer    NrRecs
     The maximum number of records available for reading. The actual number of records may be less when a filter is applied to the records read.

gdxDataSliceUELS 

Map a slice index into the corresponding unique elements. After calling DataReadSliceStart, index positions are mapped from 0 to N(d)-1. This function maps this index space back into unique elements (strings). 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  TgdxUELIndex    SliceKeyInt
     The slice index to be mapped to strings
  out  TgdxStrIndex    KeyStr
     The index of the record or element using strings for the unique elements/Array of strings containing the unique elements (gdxDataSliceUELS)

gdxDataWriteDone 

Finish a write operation. 0 if the operation is not possible.

Type
Function returns Integer

gdxDataWriteMap 

Write a data element in mapped mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  TgdxUELIndex    KeyInt
     Index of the record/element
  const  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)

gdxDataWriteMapStart 

Start writing a new symbol in mapped mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  ShortString    SyId
     Name of the acronym/symbol; might be an empty string at gdxAcronymName
  const  ShortString    ExplTxt
     Explanatory text for the symbol
   Integer    Dimen
     Dimension of the symbol/index space; index space means the number of index positions that is not fixed (gdxDataReadSlice)
   Integer    Typ
     Type of the symbol
   Integer    UserInfo
     Any integer value/User field value (gdxSymbolInfoX)

gdxDataWriteRaw 

Write a data element in raw mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  TgdxUELIndex    KeyInt
     Index of the record/element
  const  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)

gdxDataWriteRawStart 

Start writing a new symbol in raw mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  ShortString    SyId
     Name of the acronym/symbol; might be an empty string at gdxAcronymName
  const  ShortString    ExplTxt
     Explanatory text for the symbol
   Integer    Dimen
     Dimension of the symbol/index space; index space means the number of index positions that is not fixed (gdxDataReadSlice)
   Integer    Typ
     Type of the symbol
   Integer    UserInfo
     Any integer value/User field value (gdxSymbolInfoX)

gdxDataWriteStr 

Write a data element in string mode. Each element string must follow the GAMS rules for unique elements. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  TgdxStrIndex    KeyStr
     The index of the record or element using strings for the unique elements/Array of strings containing the unique elements (gdxDataSliceUELS)
  const  TgdxValues    Values
     Values of the element (gdxDataWrite...)/Data of the record (gdxDataRead..., gdxDataErrorRecord)

gdxDataWriteStrStart 

Start writing a new symbol in string mode. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  ShortString    SyId
     Name of the acronym/symbol; might be an empty string at gdxAcronymName
  const  ShortString    ExplTxt
     Explanatory text for the symbol
   Integer    Dimen
     Dimension of the symbol/index space; index space means the number of index positions that is not fixed (gdxDataReadSlice)
   Integer    Typ
     Type of the symbol
   Integer    UserInfo
     Any integer value/User field value (gdxSymbolInfoX)

gdxErrorCount 

Total number of errors encountered.

Type
Function returns Integer

gdxErrorStr 

Returns the text for a given error number. Always nonzero.

Type
Function returns Integer
Parameters
   Integer    ErrNr
     Error number (gdxErrorStr)/Error code or zero if there is no error
  out  ShortString    ErrMsg
     Error text

gdxFileInfo 

Returns file format number and compression level used. Always nonzero.

Type
Function returns Integer
Parameters
  out  Integer    FileVer
     File format number or zero if the file is not open
  out  Integer    ComprLev
     Compression used; 0=no compression, 1=zlib

gdxFileVersion 

Return strings for file version and file producer. Always nonzero.

Type
Function returns Integer
Parameters
  out  ShortString    FileStr
     Version string
  out  ShortString    ProduceStr
     Producer string

gdxFilterExists 

Check if there is a filter defined based on its number as used in gdxFilterRegisterStart. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    FilterNr
     Filter number

gdxFilterRegister 

Add a unique element to the current filter definition. 0 if the index number is out of range or was never mapped into the user index space.

Type
Function returns Integer
Parameters
   Integer    UelMap
     Unique element number in the user index space or -1 if element was never mapped

gdxFilterRegisterDone 

Finish registration of unique elements for a filter. 0 if the operation is not possible.

Type
Function returns Integer

gdxFilterRegisterStart 

Define a unique element filter. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    FilterNr
     Filter number

gdxFindSymbol 

Search for a symbol by name (case insensitive). When the symbol is found, SyNr contains the symbol number and the function returns a nonzero, else it returns 0.

Type
Function returns Integer
Parameters
  const  ShortString    SyId
     Name of the acronym/symbol; might be an empty string at gdxAcronymName
  out  Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe

gdxGetDLLVersion 

Returns a version descriptor of the library. Always nonzero

Type
Function returns Integer
Parameters
  out  ShortString    V
     Input value, possibly representing an acronym/Version string after return (gdxGetDLLVersion)

gdxGetDomainElements 

Get the unique elements for a given dimension of a given symbol.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
   Integer    DimPos
   Integer    FilterNr
     Filter number
  TDomainIndexProc    DP
    Procedure ( RawIndex : Integer, MappedIndex : Integer, Uptr : Pointer )
     Callback procedure that will be called for each item
  out  Integer    NrElem
   Pointer    Uptr

gdxGetElemText 

Retrieve the string and node number for an entry in the string table. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    TxtNr
     The index number assigned to this string (gdxAddSetText)/String table index (gdxGetElemText)/Index number of the entry to be modified (gdxSetTextNodeNr)
  out  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)
  out  Integer    Node
     Node number of the entry (gdxGetElemText)/New Node value for the entry (gdxSetTextNodeNr)

gdxGetLastError 

Returns the last error number or 0 if there was no error. Calling this function will clear the last error stored.

Type
Function returns Integer

gdxGetMemoryUsed 

Get memory in use by gdx object.

Type
Function returns Int64

gdxGetSpecialValues 

Retrieve the internal values for special values. Always nonzero.

Type
Function returns Integer
Parameters
  var  TgdxSVals    AVals
     Array of special values used for Eps, +Inf, -Inf, NA and Undef

gdxGetUEL 

Get the string for a unique element using a mapped index. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    UelNr
     Internal unique element number or -1 if not found
  out  ShortString    Uel
     String for the unique element

gdxMapValue 

Classify a value as a potential special value. Nonzero if D is a special value, 0 otherwise.

Type
Function returns Integer
Parameters
   Double    D
     Value to classify
  out  Integer    sv
     Classification

gdxOpenAppend 

Open an existing gdx file for output. Nonzero if the file can be opened, 0 otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    FileName
     File name of the gdx file to be opened
  const  ShortString    Producer
     Name of program that appends to/creates the gdx file
  out  Integer    ErrNr
     Error number (gdxErrorStr)/Error code or zero if there is no error

gdxOpenRead 

Open an existing gdx file for input. Nonzero if the file can be opened, 0 otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    FileName
     File name of the gdx file to be opened
  out  Integer    ErrNr
     Error number (gdxErrorStr)/Error code or zero if there is no error

gdxOpenReadEx 

Open an existing gdx file for input allowing for skiping sections. Nonzero if the file can be opened, 0 otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    FileName
     File name of the gdx file to be opened
   Integer    ReadMode
     Bitmap to skip reading section 0-bit: strings
  out  Integer    ErrNr
     Error number (gdxErrorStr)/Error code or zero if there is no error

gdxOpenWrite 

Open a new gdx file for output. Nonzero if the file can be opened, 0 otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    FileName
     File name of the gdx file to be opened
  const  ShortString    Producer
     Name of program that appends to/creates the gdx file
  out  Integer    ErrNr
     Error number (gdxErrorStr)/Error code or zero if there is no error

gdxOpenWriteEx 

Open a new gdx file for output with optional compression. Nonzero if the file can be opened, 0 otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    FileName
     File name of the gdx file to be opened
  const  ShortString    Producer
     Name of program that appends to/creates the gdx file
   Integer    Compr
     Zero for no compression; nonzero uses compression if available
  out  Integer    ErrNr
     Error number (gdxErrorStr)/Error code or zero if there is no error

gdxRenameUEL 

Rename a previously known unique element.

Type
Function returns Integer
Parameters
  const  ShortString    OldName
     Name of an existing UEL
  const  ShortString    NewName
     New name of the UEL

gdxResetSpecialValues 

Reset the internal values for special values. Always nonzero.

Type
Function returns Integer

gdxSetHasText 

Test if any of the unique elements in a set has associated text. Nonzero if the Set contains at least one unique element that has associated text, 0 otherwise

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe

gdxSetReadSpecialValues 

Set internal values for special values when reading a gdx file. Before calling this function, initialize the array of special values by calling gdxGetSpecialValues first. Always nonzero

Type
Function returns Integer
Parameters
  const  TgdxSVals    AVals
     Array of special values used for Eps, +Inf, -Inf, NA and Undef

gdxSetSpecialValues 

Set internal values for special values. Before calling this function, initialize the array of special values by calling gdxGetSpecialValues first. Note, values in AVals have to be unique. Nonzero if all values specified are unique, 0 otherwise.

Type
Function returns Integer
Parameters
  const  TgdxSVals    AVals
     Array of special values used for Eps, +Inf, -Inf, NA and Undef

gdxSetTextNodeNr 

Set the Node number for an entry with Index N in the string table. After registering a string with AddSetText, we can assign a node number for later retrieval. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    TxtNr
     The index number assigned to this string (gdxAddSetText)/String table index (gdxGetElemText)/Index number of the entry to be modified (gdxSetTextNodeNr)
   Integer    Node
     Node number of the entry (gdxGetElemText)/New Node value for the entry (gdxSetTextNodeNr)

gdxSetTraceLevel 

Set the amount of trace (debug) information generated. Always nonzero.

Type
Function returns Integer
Parameters
   Integer    N
     Index number/Tracing level, N=<0 no tracing N>=3 maximum tracing (gdxSetTraceLevel)/Line number (gdxSymbolGetComment)
  const  ShortString    s
     String to be included in trace output(gdxSetTraceLevel)

gdxSymbIndxMaxLength 

Returns the length of the longest UEL used for every index position for a given symbol.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  var  TgdxUELIndex    LengthInfo
     The longest length for each index position

gdxSymbMaxLength 

Returns the length of the longest symbol name.

Type
Function returns Integer

gdxSymbolAddComment 

Add a line of comment text for a symbol. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  const  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)

gdxSymbolDim 

Retrieve dimension of a symbol.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe

gdxSymbolGetComment 

Retrieve a line of comment text for a symbol. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
   Integer    N
     Index number/Tracing level, N=<0 no tracing N>=3 maximum tracing (gdxSetTraceLevel)/Line number (gdxSymbolGetComment)
  out  ShortString    Txt
     Explanatory text of the acronym (gdxAcronym...)/String to be registered(gdxAddSetText)/Text found for the entry (gdxGetElemText)/String to add (gdxSymbolAddComment)/String containing requested line(gdxSymbolGetComment)

gdxSymbolGetDomain 

Retrieve the domain of a symbol. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  var  TgdxUELIndex    DomainSyNrs

gdxSymbolGetDomainX 

Retrieve the domain of a symbol (Relaxed version). 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  out  TgdxStrIndex    DomainIDs
     Array containing the set identifiers or * of the domain for the corresponding index position

gdxSymbolInfo 

Returns information about a symbol. 0 if the symbol number is out of range, nonzero otherwise.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  out  ShortString    SyId
     Name of the acronym/symbol; might be an empty string at gdxAcronymName
  out  Integer    Dimen
     Dimension of the symbol/index space; index space means the number of index positions that is not fixed (gdxDataReadSlice)
  out  Integer    Typ
     Type of the symbol

gdxSymbolInfoX 

Returns additional information about a symbol. 0 if the symbol number is out of range, nonzero otherwise.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  out  Integer    RecCnt
     Total number of records stored (unmapped)
  out  Integer    UserInfo
     Any integer value/User field value (gdxSymbolInfoX)
  out  ShortString    ExplTxt
     Explanatory text for the symbol

gdxSymbolSetDomain 

Define the domain of the symbol for which a write data operation just started using DataWriteRawStart, DataWriteMapStart or DataWriteStrStart. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  TgdxStrIndex    DomainIDs
     Array containing the set identifiers or * of the domain for the corresponding index position

gdxSymbolSetDomainX 

Define the domain of symbol SyNr (Relaxed version). 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    SyNr
     The index number of the symbol, range from 0 to NrSymbols; SyNr = 0 reads universe
  const  TgdxStrIndex    DomainIDs
     Array containing the set identifiers or * of the domain for the corresponding index position

gdxSystemInfo 

Returns the number of symbols and unique elements. Always nonzero.

Type
Function returns Integer
Parameters
  out  Integer    SyCnt
     Number of symbols available in the gdx file
  out  Integer    UelCnt
     Number of unique elements

gdxUELMaxLength 

Returns the length of the longest UEL name.

Type
Function returns Integer

gdxUELRegisterDone 

Finish registration of unique elements. 0 if the operation is not possible.

Type
Function returns Integer

gdxUELRegisterMap 

Register a unique element in mapped mode. A unique element must follow the GAMS rules when it contains quote characters. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    UMap
     User index number to be assigned to the unique element, -1 if not found or the element was never mapped
  const  ShortString    Uel
     String for the unique element

gdxUELRegisterMapStart 

Start registering unique elements in mapped mode. 0 if the operation is not possible.

Type
Function returns Integer

gdxUELRegisterRaw 

Register a unique element in raw mode. This can only be used while writing to a gdx file. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
  const  ShortString    Uel
     String for the unique element

gdxUELRegisterRawStart 

Start registering unique elements in raw mode. 0 if the operation is not possible.

Type
Function returns Integer

gdxUELRegisterStr 

Register a unique element in string mode. A unique element must follow the GAMS rules when it contains quote characters. Nonzero if the element was registered, zero otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    Uel
     String for the unique element
  out  Integer    UelNr
     Internal unique element number or -1 if not found

gdxUELRegisterStrStart 

Start registering unique elements in string mode. 0 if the operation is not possible.

Type
Function returns Integer

gdxUMFindUEL 

Search for a unique element by its string. Nonzero if the element was found, 0 otherwise.

Type
Function returns Integer
Parameters
  const  ShortString    Uel
     String for the unique element
  out  Integer    UelNr
     Internal unique element number or -1 if not found
  out  Integer    UelMap
     Unique element number in the user index space or -1 if element was never mapped

gdxUMUelGet 

Get a unique element using an unmapped index. 0 if the operation is not possible.

Type
Function returns Integer
Parameters
   Integer    UelNr
     Internal unique element number or -1 if not found
  out  ShortString    Uel
     String for the unique element
  out  Integer    UelMap
     Unique element number in the user index space or -1 if element was never mapped

gdxUMUelInfo 

Returns information about the unique elements. Always nonzero.

Type
Function returns Integer
Parameters
  out  Integer    UelCnt
     Number of unique elements
  out  Integer    HighMap