I've been pluggin away at all this stuff, everything was working wonderfuly. We've all been there... we make some change somewhere and we don't know what change you made that broke something, but you broke something...
so I'm running this function...
Function InitContentList() as object
list = CreateObject("roAssociativeArray")
xfer=createobject("rourltransfer")
xfer.seturl("[site]")
print "Getting Content from " + m.contentlist + "?" + "DeviceID=" + GetDeviceESN() + "®token=" + loadRegistrationToken()
RawXMLData=xfer.gettostring()
PRINT RAWXMLDATA
xml=createobject("roXMLElement")
contentlist = []
if xml.parse(RawXMLData) then
for each obj in xml.item
contentlist.push({
title: obj.title.gettext()
id: obj.id.gettext()
SDBackgroundImageUrl: obj.SDBackgroundImageUrl.gettext()
HDBackgroundImageUrl: obj.HDBackgroundImageUrl.gettext()
ShortDescriptionLine1: obj.ShortDescriptionLine1.gettext()
ShortDescriptionLine2: obj.ShortDescriptionLine2.gettext()
function: obj.function.gettext()
url: obj.url.gettext()
par: obj.par.gettext()
register: obj.register.gettext()
})
print obj.title.gettext()
print obj.ID.gettext()
print obj.SDBackgroundImageUrl.gettext()
print obj.HDBackgroundImageUrl.gettext()
print obj.ShortDescriptionLine1.gettext()
print obj.ShortDescriptionLine2.gettext()
print obj.function.gettext()
print obj.url.gettext()
print obj.par.gettext()
print obj.register.gettext()
next
else
ShowDialog1Button("SORRY!", "Currently a problem with our servers. Please try again later.", "OK")
print "parse failed"
end if
'printAA(contentlist)
'printAA(contentlist[0])
return contentlist
End Function
PRINT RAWXMLDATA prints the XML in it's entirety. No problem.
print obj. works for each and gives me what should be there each time around.
when I printAA, I get "Nothing from for each. Looks like :?roFunction?"
when I printAA[0]... which worked before, It would print that array index no problem. now when I do it, I get Array operation attempted on variable not DIM'd. (runtime error &he7)
using contentlist = CreateObject("roArray", 100, true) or contentlist = [] returns same result (what's the difference anyhow? curious.)