beautypg.com

BrightSign BrightScript 2 Reference Guide User Manual

Page 48

background image

48

ba2.ReadFile("ByteArrayTestFile")
if ba.Count()<>ba2.Count() then stop
for x=0 to 4000

if ba[x]<>ba2[x] then stop

next

ba2.ReadFile("ByteArrayTestFile", 10, 100)
if ba2.count()<>100 then stop
for x=10 to 100

if ba2[x-10]<>x then stop

next

roXMLElement

Also see the section “BrightScript XML Support” for details of using the dot and @
shortcuts for many of these member functions.

roXMLElement is used to contain an XML tree. It has one interface: ifXMLElement

GetBody() As Object
GetAttributes() As Object
GetName() As String
GetText() As String
GetChildElements() As Object
GetNamedElements(As String) As Object
Parse(s As String) As Boolean
SetBody(As Object) As Void
AddBodyElement() As Oject
AddElement(As String) As Void
AddElementWithBody(As String, As Object) As Object
AddAttribute(As String, As String) As Void
SetName(As String) As Void
Parse(As String) As Boolean
GenXML(gen_header As String) As String
Clear() As Void
GenXMLHeader()
IsName(As String) Ad Boolean
HasAttribute(As String) As Boolean

Example:
this is some text

Would parse such that:
Name = tag1
Attributes = invalid
Body = roString containing “this is some text”