From: Hollywood_t on
I am using the following code which works fine except when the
'NamedItem' does not exist.
For some reason, the XML I am retrieving does not have a consistent
number of fields in each node.
I know I can work around this by looping through all of the attributes
and matching the NodeNames with the FieldNames I need, however, maybe
someone can tell me how to compare VB's NOTHING in CAVO.

oXMLFields:Attributes:getNamedItem( "CustomerPhone2" ):NodeTypedValue

In VB you can assign
oXMLFields:Attributes:getNamedItem( "CustomerPhone2" ) to an object
variable and then check if it is equal to "NOTHING" before using any
of the objects attributes.

Thanks
Nick
From: Hollywood_t on
Have resolved the problem by interogating the object.
Invalid objects have different values to valid ones.

Modified the function listed below which is found in the CAVO Help
File

FUNCTION OOpsCheck(uObject) AS LOGIC

LOCAL lSuccess AS LOGIC
LOCAL aObject AS ARRAY
lSuccess := IsObject(uObject)
IF lSuccess
// Display object contents
aObject := Object2Array(uObject)
FOR i := UPTO ALen(aObject)
QOut(aObject[i])
NEXT
ELSE
? "Object is required"
ENDIF
RETURN lSuccess

Nick