Xml_To_Variable - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Reserved Identifiers
Keywords & Run-Time Library Functions (Cont.)

XML_TO_VARIABLE

162
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
{
NetLinx Programming Language Reference Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents