
Reserved Identifiers
159
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
VARIABLE_TO_XML
SINTEGER VARIABLE_TO_XML(CONSTANT VARIANTARRAY A,CHAR
B[], LONG C, LONG D)
Where:
•
A
is the variable (any type) to be encoded:
•
B
is the
CHAR
array to hold the resulting XML.
•
C
is the beginning encoding position. Encoding will start as
B[C]
.
•
D
is the encoding flag. These can be used together.
Value $01
is "Encode with Types". If the bit is set, types will be included for
every variable being encoded. The default is to not include types. The
constant
XML_ENCODE_TYPES
can be used to specify this flag.
Value $10
is "Encoded CHAR arrays as using data list". The constant
XML_ENCODE_CHAR_AS_LIST
can be used to specify this flag. See the
Encoding and Decoding: Binary and XML
section on page 209.
Value $20
is "Array Encoding is Little-Ending". The constant
XML_ENCODE_LE
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’
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...