Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ARRAY
#1
I've tried and tried to figure this stuff out on my own, but breaking apart an ARRAY with data in an XML is just kicking my but.

Please show example for how to populate a ComboBox with Data in this example:
<ROOT>
,<CHILD>
,,<CC>
,,,<SUB1>Data1</SUB1>
,,,<SUB2>Data2</SUB2>
,,</CC>
,,<CC>
,,,<SUB1>Data3</SUB1>
,,,<SUB2>Data4</SUB2>
,,</CC>
,</CHILD>
</ROOT>

I would want the combo box to be populated with Data 1 and Data 2...each are from SUB1...

I know it is ARRAY...and a "for" but, I just don't really have a good grasp...so a bit of theory and explanation would be great along with a how to.

Thanks,
Jimmy Vig
#2
Macro
Code:
Copy      Help
str s=
;<ROOT>
,;<CHILD>
,,;<CC>
,,,;<SUB1>Data1</SUB1>
,,,;<SUB2>Data2</SUB2>
,,;</CC>
,,;<CC>
,,,;<SUB1>Data3</SUB1>
,,,;<SUB2>Data4</SUB2>
,,;</CC>
,;</CHILD>
;</ROOT>
IXml xml=CreateXml
xml.FromString(s)

ARRAY(IXmlNode) a
xml.Path("ROOT/CHILD/CC" a)
int i
for i 0 a.len
,str sub1=a[i].ChildValue("SUB1")
,str sub2=a[i].ChildValue("SUB2")
,s.format("%s, %s" sub1 sub2)
,out s
,


Forum Jump:


Users browsing this thread: 1 Guest(s)