GXWA class

class geosoft.gx.GXWA
The WA class enables you to access and write data to ASCII files.
static create((GXContext)ctx, (str)arg1, (int)arg2) → GXWA:
Creates an ASCII file to write to.
Parameters:
Returns:

WA Handle

Return type:

geosoft.gx.GXWA

New in version 5.0.0.

Note:

ANSI Encoding is assumed, See geosoft.gx.GXWA.create_ex() to override this.
static create_ex((GXContext)ctx, (str)arg1, (int)arg2, (int)arg3) → GXWA:
Creates an ASCII file to write to.
Parameters:
Returns:

WA Handle

Return type:

geosoft.gx.GXWA

New in version 6.2.0.

Note:

Before version 6.2. text in on the GX API level were handled as characters in the current ANSI code page
defining how characters above ASCII 127 would be displayed. 6.2. introduced Unicode in the core
montaj engine that greatly increased the number of symbols that can be used. The WA_ENCODE constants
were introduce that controls how text are written to files on disk with the WA class.
static create_sbf((GXContext)ctx, (GXSBF)arg1, (str)arg2, (int)arg3) → GXWA:
Creates an ASCII file to write to in an SBF.
Parameters:
Returns:

WA Handle

Return type:

geosoft.gx.GXWA

New in version 5.0.0.

Note:

See sbf.gxh. ANSI Encoding is assumed, See geosoft.gx.GXWA.create_sbf_ex() to override this.
static create_sbf_ex((GXContext)ctx, (GXSBF)arg1, (str)arg2, (int)arg3, (int)arg4) → GXWA:
Creates an ASCII file to write to in an SBF.
Parameters:
Returns:

WA Handle

Return type:

geosoft.gx.GXWA

New in version 6.2.0.

Note:

Also see sbf.gxh
Before version 6.2. text in on the GX API level were handled as characters in the current ANSI code page
defining how characters above ASCII 127 would be displayed. 6.2. introduced Unicode in the core
montaj engine that greatly increased the number of symbols that can be used. The WA_ENCODE constants
were introduce that controls how text are written to files on disk with the WA class.
is_null() → bool

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

Returns:True if this is a null instance of geosoft.gx.GXWA, False otherwise.
Return type:bool`
new_line() → None:
Forces a new line in the WA object.
Returns:Nothing
Return type:None

New in version 5.0.0.

static null() → GXWA

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

Returns:A null geosoft.gx.GXWA
Return type:geosoft.gx.GXWA
puts((str)arg1) → None:
Writes a string to the file.
Parameters:arg1 (str) – String to write
Returns:Nothing
Return type:None

New in version 5.0.0.

WA_ENCODE constants

WA Encode defines
gx.WA_ENCODE_ANSI = 0
Current Ansi Code Page (Conversion from UTF-8 data, if an exisiting BOM header found with WA_APPEND,
encoding will switch to WA_ENCODE_UTF8)
gx.WA_ENCODE_RAW = 1
Write all data without any conversion check
gx.WA_ENCODE_UTF8 = 2
UTF8 (If no exisiting BOM header found with WA_APPEND, encoding will switch to WA_ENCODE_ANSI)
gx.WA_ENCODE_UTF8_NOHEADER = 3
UTF8 w.o. header (will assume UTF8 encoding if WA_APPEND is used)
gx.WA_ENCODE_UTF16_NOHEADER = 4
UTF16 w.o. header (will assume UTF16 encoding if WA_APPEND is used)

WA_OPEN constants

WA Open defines
gx.WA_NEW = 0
Create new file
gx.WA_APPEND = 1
Append to existing file