GXGER class

class geosoft.gx.GXGER
Allows access to a Geosoft format error message file. This class
does not in itself produce an error message, but retrieves a
selected message from the file, and allows the
setting of replacement parameters within the message. It
is up to the user to display or use the message.

Note:

GER message files contain numbered messages that can be used within GXs.
Following is an example from the file GEOSOFT.GER:


      #20008
      ! Invalid password. The product installation has failed.

      #20009
      ! Unable to find INI file: %1
      ! See the documentation for details


A '#' character in column 1 indicates a message number.  The message
follows on lines that begin with a '!' character.  Strings in the message
may be replaced at run time with values using the geosoft.gx.GXGER.set_string(),
geosoft.gx.GXGER.set_int() and geosoft.gx.GXGER.set_double() methods. The iGet_GER will return the message
with strings replaced by their settings.  By convention, we recommend
that you use "%1", "%2", etc. as replacement strings.
static create((GXContext)ctx, (str)arg1) → GXGER:
Opens an ASCII error file to read from.
Parameters:
Returns:

GER Object

Return type:

geosoft.gx.GXGER

New in version 5.0.0.

Note:

The GER file may be in the local directory or the GEOSOFT
directory.
get((int)arg1, (str_ref)arg2) → int:
Get a message string.
Parameters:
  • arg1 (int) – message number
  • arg2 (geosoft.gx.str_ref) – message string returned, replacements filtered
Returns:

0 if message found 1 if no message, passed message remains unchanged

Return type:

int

New in version 5.0.0.

is_null() → bool

Check if the instance of geosoft.gx.GXGER is null (undefined)

Returns:True if this is a null instance of geosoft.gx.GXGER, False otherwise.
Return type:bool`
static null() → GXGER

A null (undefined) instance of geosoft.gx.GXGER

Returns:A null geosoft.gx.GXGER
Return type:geosoft.gx.GXGER
set_double((str)arg1, (float)arg2) → None:
Set a replacement string value to a real.
Parameters:
  • arg1 (str) – replacement string (ie. “%1”)
  • arg2 (float) – setting
Returns:

Nothing

Return type:

None

New in version 5.0.0.

set_int((str)arg1, (int)arg2) → None:
Set a replacement string value to an int.
Parameters:
  • arg1 (str) – replacement string (ie. “%1”)
  • arg2 (int) – setting
Returns:

Nothing

Return type:

None

New in version 5.0.0.

set_string((str)arg1, (str)arg2) → None:
Set a replacement string value.
Parameters:
  • arg1 (str) – replacement string (ie. “%1”)
  • arg2 (str) – setting
Returns:

Nothing

Return type:

None

New in version 5.0.0.