Reserved Identifiers
162
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
XML_TO_VARIABLE
SINTEGER XML_TO_VARIABLE(VARIANTARRAY A,CONSTANT CHAR
B[], LONG C, LONG D)
Where:
•
A
is the variable (any type) to be encoded.
•
B
is the
CHAR
array holding the source XML.
•
C
is the next beginning encoding position. Encoding ended at
B[C-1]
.
•
D
are the decoding flags. They can be used together.
Value $01
is "Force Types When Decoding". If the type in the XML does not
match the variable typed being decoded to, the variable will not be written
and the variable will be skipped in the XML. The constant
XML_DECODE_TYPES
can be used to specify this flag.
Value $10
is "Do Not preserve current value of A". If set, A will be cleared if
not explicitly set. The constant
XML_DECODE_NO_PRESERVE
can be used to
specify this flag.
The return value is:
• 3 = XML decode data type mismatch
• 2 = XML decode data too small, more members in structure
• 1 = Structure too small, more members in XML decode string
• 0 = Decoded OK
• -1 = Decode variable type mismatch
• - 2 = Decode data too small, decoder ran out of data. Most likely poorly
formed XML.
• -3 = Output character buffer was too small.
Example:
DEFINE_TYPE
STRUCTURE _AlbumStruct
{
LONG lTitleID
CHAR sArtist[100]
CHAR sTitle[100]
}
DEFINE_VARIABLE
_AlbumStruct MyAlbumStruct[3]
LONG lPos
SLONG slReturn
SLONG slFile
SLONG slResult
CHAR sBinaryString[10000]
CHAR sXMLString[50000]
DEFINE_START
MyAlbumStruct[1].lTtleID = 11101000
MyAlbumStruct[1].sArtist = ‘Buffet, Jimmy’
MyAlbumStruct[1].sTitle = ‘Living & Dying in ¾ Time’
MyAlbumStruct[2].lTtleID = 11101012
MyAlbumStruct[2].sArtist = ‘Sinatra, Frank’
MyAlbumStruct[2].sTitle = ‘Come Fly With Me’
MyAlbumStruct[3].lTtleID = 33101000
MyAlbumStruct[3].sArtist = ‘Holiday, Billie’
MyAlbumStruct[3].sTitle = ‘Lady in satin’
DEFINE_EVENT
BUTTON_EVENT[TP,1] / /Convert And Save
{
Summary of Contents for NETLINX PROGRAMMING LANGUAGE
Page 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Page 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Page 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Page 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Page 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Page 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Page 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Page 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Page 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Page 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...