Reserved Identifiers
163
NetLinx Programming Language Reference Guide
Keywords & Run-Time Library Functions (Cont.)
XML_TO_VARIABLE
(cont.)
PUSH:
{
// Convert To Binary
lPos = 1
slReturn = VARIABLE_TO_STRING(MyAlbumStruct, sBinaryString,
lPos)
SEND_STRING 0,"’POSITION=’,ITOA(lPos),’ – Result =
‘,ITOA(slReturn)"
// Convert To XML
lPos = 1
slReturn = VARIABLE_TO_XML(MyAlbumStruct, sXMLString, lPos,
0)
SEND_STRING 0,"’POSITION=’,ITOA(lPos),’ – Result =
‘,ITOA(slReturn)"
// Save Structure to Disk - Binary
slFile = FILE_OPEN(‘BinaryEncode.xml’, 2)
slReturn = FILE_WRITE(slFile, sBinaryString,
LENGTH_STRING(sBinaryString))
slReturn = FILE_CLOSE(slFile)
// Save Structure To Disk – XML
slFile = FILE_OPEN(‘xmlEncode.xml’, 2)
slReturn = FILE_WRITE(slFile, sXMLString,
LENGTH_STRING(sXMLString))
slReturn = FILE_CLOSE(slFile)
}
RELEASE:
{
}
}
BUTTON_EVENT[TP,2] // Read and Decode
{
PUSH:
{
// Read Binary File
slFile = FILE_OPEN(‘BinaryEncode.xml’,1)
slResult = FILE_READ(slFile, sBinaryString,
MAX_LENGTH_STRING(sBinaryString)
slResult = FILE_CLOSE (slFile)
// Read XML File
slFile = FILE_OPEN(‘XMLEncode.xml’,1)
slResult = FILE_READ(slFile, sXMLString,
MAX_LENGTH_STRING(sXMLString))
slResult = FILE_CLOSE (slFile)
// Convert To Binary
lPos = 1
slReturn = STRING_TO_VARIABLE(MyAlbumStruct, sBinaryString,
slPos)
// OR Convert To XML
slPos = 1
slReturn = XML_TO_VARIABLE (MyAlbumStruct, sXMLString,
slPos, 0)
}
RELEASE:
{
}
}
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...