GXREG class

class geosoft.gxapi.GXREG
The REG class is used for storing and retrieving named
variables. Many classes contain REG objects for storing
information particular to the class.  The META class supersedes
the REG class and is gradually replacing the use of the
REG class in newer applications.
clear() → None:
Clears all the parameters in a REG object
Returns:Nothing
Return type:None

New in version 5.0.0.

copy((GXREG)arg1) → None:
Copy
Parameters:arg1 (geosoft.gxapi.GXREG) – source
Returns:Nothing
Return type:None

New in version 5.0.0.

static create((int)arg1) → GXREG:
Create a handle to a REG object
Parameters:arg1 (int) – maximum size of “parameter=setting” string.
Returns:REG Object
Return type:geosoft.gxapi.GXREG

New in version 5.0.0.

static create_s((GXBF)arg1) → GXREG:
Create a handle to a REG object from a BF
Parameters:arg1 (geosoft.gxapi.GXBF) – BF handle for file containing serialized REG
Returns:REG Object
Return type:geosoft.gxapi.GXREG

New in version 5.0.0.

entries() → int:
Get the number of parms in a REG object
Returns:Number of parms in a REG object.
Return type:int

New in version 5.1.1.

get((str)arg1, (str_ref)arg2) → None:
Gets a string for a specified parameter in the REG object
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

get_double((str)arg1, (float_ref)arg2) → None:
Gets an real for a specified parameter in the REG object
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If parameter is not present in REG, rDUMMY is returned.
get_int((str)arg1, (int_ref)arg2) → None:
Gets an int for a specified parameter in the REG object
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

If parameter is not present in REG, iDUMMY is returned.
get_one((int)arg1, (str_ref)arg2, (str_ref)arg3) → None:
Gets n-th entry of the REG object
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.1.1.

is_null() → bool

Check if the instance of geosoft.gxapi.GXREG is null (undefined)

Returns:True if this is a null instance of geosoft.gxapi.GXREG, False otherwise.
Return type:bool`
load_ini((str)arg1) → None:
Load a registry from an INI file.
Parameters:arg1 (str) – INI file name
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

Items are loaded into the REG in the format "GROUP.ITEM".
match_string((str)arg1, (str_ref)arg2) → None:
Replace a string with reg settings.
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

merge((GXREG)arg1, (int)arg2) → None:
Merge
Parameters:
Returns:

Nothing

Return type:

None

New in version 5.0.0.

static null() → GXREG

A null (undefined) instance of geosoft.gxapi.GXREG

Returns:A null geosoft.gxapi.GXREG
Return type:geosoft.gxapi.GXREG
save_ini((str)arg1) → None:
Save a REG to an INI file.
Parameters:arg1 (str) – INI file name
Returns:Nothing
Return type:None

New in version 5.0.0.

Note:

Only REG parameters in the form "GROUP.ITEM" are
dumped to the INI file, because they match the INI format
which groups items under [GROUP] headings.
Single-word items (without a separating period) are skipped.
serial((GXBF)arg1) → None:
Serialize a REG object into a file.
Parameters:arg1 (geosoft.gxapi.GXBF) – BF to serialize REG into
Returns:Nothing
Return type:None

New in version 5.0.0.

set((str)arg1, (str)arg2) → None:
Sets a string parameter in the REG object
Parameters:
  • arg1 (str) – Name of the parameter
  • arg2 (str) – String to set it to An empty string sets the setting to an empty string, but does NOT remove the parameter from the REG.
Returns:

Nothing

Return type:

None

New in version 5.0.0.

Note:

To remove a parameter completely, use one of the
following:

geosoft.gxapi.GXREG.set_int()(Reg, sParam, iDUMMY);
or
geosoft.gxapi.GXREG.set_double()(Reg, sParam, rDUMMY);
set_double((str)arg1, (float)arg2) → None:
Sets an real for a specified parameter in the REG object
Parameters:
  • arg1 (str) – Name of the parameter
  • arg2 (float) – Real to set, rDUMMY to remove the parameter
Returns:

Nothing

Return type:

None

New in version 5.0.0.

set_int((str)arg1, (int)arg2) → None:
Sets an int for a specified parameter in the REG object
Parameters:
  • arg1 (str) – Name of the parameter
  • arg2 (int) – Int to set, iDUMMY to remove the parameter
Returns:

Nothing

Return type:

None

New in version 5.0.0.

REG_MERGE constants

REG merge options
gxapi.REG_MERGE_REPLACE = 0
Replace Values
gxapi.REG_MERGE_ADD = 1
Only append values