
A2.3 Macros to access OxVALUEs 37
A2.3 Macros to access OxVALUEs
The OxVALUE is the container for all Ox types. It contains the type identifier, a range
of property flags, and the actual data. The type, flags and data can be accessed through
functions listed above, or through macros when using C or C
++
. All constants, types
and macros are defined in oxtypes.h. The Visual Basic file oxwin.bas defines the
constants and flags for use in Basic programs. For example, macros are defined to
access the type of an OxVALUE:
ISINT(pv) TRUE if integer type
ISDOUBLE(pv) TRUE if double type
ISMATRIX(pv) TRUE if MATRIX type
ISSTRING(pv) TRUE if string type (array of characters)
ISARRAY(pv) TRUE if array of OxVALUEs
ISFUNCTION(pv) TRUE if function type (written in Ox code)
ISCLASS(pv) TRUE if class object type
ISINTFUNC(pv) TRUE if internal (library) function
ISFILE(pv) TRUE if file type
GETPVTYPE(pv) gets the type of the argument
ISNULL(pv) TRUE if has OX
NULL property
ISADDRESS(pv) TRUE if has OX
ADDRESS property
An OxVALUE is a structure which contains a union of other structures. For example
when using OxVALUE *pv:
GETPVTYPE(pv) content description
OX INT pv->type type and property flags
pv->t.ival integer value
OX
DOUBLE pv->type type and property flags
pv->t.dval double value
OX
MATRIX pv->type type and property flags
pv->t.mval.data MATRIX value
pv->t.mval.c number of columns
pv->t.mval.r number of rows
OX
STRING pv->type type and property flags
pv->t.sval.size string length
pv->t.sval.data actual string (null terminated)
OX
ARRAY pv->type type and property flags
pv->t.aval.size array length
pv->t.aval.data pointer to array of OxVALUEs
Komentarze do niniejszej Instrukcji