UniBasic Commands Reference - Rocket Software
UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software
ReadXMLData Syntax ReadXMLData(xml_data_handle, rec) Note: This function is case-sensitive. If you want it to be case-insensitive, you must compile your programs using the BASIC command with the -i option. Description After opening the XML document with the OpenXMLData function, read the document using the ReadXMLData function. UniBASIC returns the XML data as a dynamic array. Syntax The following table describes each parameter of the syntax. Parameter Description After you read the XML document, you can execute any UniBASIC statement or function against the data. 1-660 UniBasic Commands Reference xml_data_handle A variable that holds the XML data handle created by the OpenXMLData function. rec A mark-delimited dynamic array containing the extracted data. ReadXMLData Parameters
Status Codes The status code can be one of the following: Status Code Description XML.SUCCESS Success XML.ERROR Failure XML.INVALID.HANDLE Invalid xml_data_handle XML.EOF End of data ReadXMLData Status Codes Example The following example illustrates use of the ReadXMLData function: MOREDATA=1 LOOP WHILE (MOREDATA=1) status = ReadXMLData(STUDENT_XML,rec) IF status = XML.ERROR THEN STOP “Error when preparing the XML document. “ END ELSE IF status = XML.EOF THEN PRINT “No more data” MOREDATA = 0 END ELSE PRINT “rec = “:rec END REPEAT ReadXMLData 1-661
- Page 652 and 653: READFWD Syntax READFWD dyn.array.va
- Page 654 and 655: Example In the following example, t
- Page 656 and 657: Parameters The following table desc
- Page 658 and 659: Related Commands UniBasic READBCK,
- Page 660 and 661: Parameters The following table desc
- Page 662 and 663: Related Commands UniBasic READBCK,
- Page 664 and 665: Parameters The following table desc
- Page 666 and 667: UniData DEFAULT.LOCKED.ACTION - For
- Page 668 and 669: Parameters The following table desc
- Page 670 and 671: READNEXT Syntax READNEXT id.var [,
- Page 672 and 673: Parameter Description Examples In t
- Page 674 and 675: READNEXTTUPLE Syntax READNEXTTUPLE
- Page 676 and 677: Example In the following example, t
- Page 678 and 679: READSEQ Syntax READSEQ var FROM seq
- Page 680 and 681: eadSocket Syntax readSocket(socket_
- Page 682 and 683: READT Syntax READT [UNIT (mu.expr)]
- Page 684 and 685: Example In the following example, t
- Page 686 and 687: Parameters The following table desc
- Page 688 and 689: Related Commands UniBasic CLOSE, DE
- Page 690 and 691: Parameter Description Examples In t
- Page 692 and 693: READVL Syntax READVL var FROM [file
- Page 694 and 695: Example In the following example, R
- Page 696 and 697: Parameters The following table desc
- Page 698 and 699: READXBCK Syntax READXBCK dyn.array.
- Page 700 and 701: READXFWD Syntax READXFWD dyn.array.
- Page 704 and 705: RECORDLOCKED Syntax RECORDLOCKED (f
- Page 706 and 707: STATUS Function Return Values After
- Page 708 and 709: Parameter Description Examples In t
- Page 710 and 711: RECORDLOCKU Syntax RECORDLOCKU [fil
- Page 712 and 713: RELEASE Syntax RELEASE [file.var [,
- Page 714 and 715: ReleaseXML Syntax ReleaseXML(XMLhan
- Page 716 and 717: Example In the following example, c
- Page 718 and 719: Parameter Description The SETTING c
- Page 720 and 721: In some implementations, the values
- Page 722 and 723: REMOVE Syntax REMOVE(dyn.array.var,
- Page 724 and 725: REPLACE Syntax REPLACE(dyn.array.ex
- Page 726 and 727: In the next example, the program se
- Page 728 and 729: RESIZET Syntax RESIZET [UNIT(mu.exp
- Page 730 and 731: RETURN Syntax RETURN [TO label[:]]
- Page 732 and 733: Examples In the following example,
- Page 734 and 735: Example In the following example, t
- Page 736 and 737: RNDSEED Syntax RNDSEED expr Descrip
- Page 738 and 739: SADD Syntax SADD(x, y) Description
- Page 740 and 741: The following table describes the s
- Page 742 and 743: Example In the following example, t
- Page 744 and 745: SELECT Syntax SELECT file.var [TO {
- Page 746 and 747: Examples The following program segm
- Page 748 and 749: SELECTINDEX Syntax SELECTINDEX inde
- Page 750 and 751: Related Commands UniBasic DELETELIS
Status Codes<br />
The status code can be one of the following:<br />
Status Code Description<br />
XML.SUCCESS Success<br />
XML.ERROR Failure<br />
XML.INVALID.HANDLE Invalid xml_data_handle<br />
XML.EOF End of data<br />
ReadXMLData Status Codes<br />
Example<br />
The following example illustrates use of the ReadXMLData function:<br />
MOREDATA=1<br />
LOOP WHILE (MOREDATA=1)<br />
status = ReadXMLData(STUDENT_XML,rec)<br />
IF status = XML.ERROR THEN<br />
STOP “Error when preparing the XML document. “<br />
END ELSE IF status = XML.EOF THEN<br />
PRINT “No more data”<br />
MOREDATA = 0<br />
END ELSE<br />
PRINT “rec = “:rec<br />
END<br />
REPEAT<br />
ReadXMLData 1-661