GXRA class

class GXRA(handle=0)

GXRA class.

The GXRA class is used to access ASCII files sequentially or by line number. The files are opened in read-only mode, so no write operations are defined

classmethod create(file)

Creates GXRA

Parameters:file (str) – Name of the file
Returns:GXRA Object
Return type:GXRA

New in version 5.0.

License: Geosoft Open License

classmethod create_sbf(sbf, file)

Creates GXRA on an GXSBF

Parameters:
  • sbf (GXSBF) – Storage
  • file (str) – Name of the file
Returns:

GXRA Object

Return type:

GXRA

New in version 5.0.

License: Geosoft Open License

Note: This method allows you to open an GXRA in a structured file storage (an GXSBF). SBFs can be created inside other data containers, such as workspaces, maps, images and databases. This lets you store application specific information together with the data to which it applies.

See also

sbf.gxh

gets(strbuff)

Get next full line from GXRA

Parameters:strbuff (str_ref) – Buffer in which to place string
Returns:0 - Ok 1 - End of file
Return type:int

New in version 5.0.

License: Geosoft Open License

is_null()

Check if this is a null (undefined) instance

Returns:True if this is a null (undefined) instance, False otherwise.
Return type:bool
len()

Returns the total number of lines in GXRA

Returns:# of lines in the GXRA.
Return type:int

New in version 5.0.

License: Geosoft Open License

line()

Returns current line #, 0 is the first

Returns:The current read line location.
Return type:int

New in version 5.0.

License: Geosoft Open License

Note: This will be the next line read.

classmethod null()

A null (undefined) instance of GXRA

Returns:A null GXRA
Return type:GXRA
seek(line)

Position next read to specified line #

Parameters:line (int) – Line #, 0 is the first.
Returns:0 if seeked line is within the range of lines, 1 if outside range, line pointer will not be moved.
Return type:int

New in version 5.0.

License: Geosoft Open License