Talk:AJAX - Return Arrays and Structs to your JavaScript with XML: Difference between revisions

m
Amendment
(Answer)
m (Amendment)
Line 38: Line 38:
: Akennard - try typing "paXML" into the VDF Help Index (that's all I did, using VDF 14.0 Help) and you will get a page which includes the following: "<font color="red">''Note: This property allocates memory for the data and it is therefore important that the data be disposed of when you are done. This is done using the Free() function.''</font>" This is the clue to what is going on: you have an XML object (hoXML is a reference to this) which you later destroy, but calling paXML has a specific (and ''documented''!!!) side effect: "<font color="red">''This property <u>allocates</u> memory...''</font>" (which, IMO, makes it a function/method, not a property... but then I'm picky!) - and into that memory it then <u>copies</u> the XML of the object it was called on (although the documentation does not explicitly state this, it does clearly imply it), so it is independent of that object and does not disappear when you "Destroy" it, which is why you need to manually "Free()" the memory when you are done. HTH.
: Akennard - try typing "paXML" into the VDF Help Index (that's all I did, using VDF 14.0 Help) and you will get a page which includes the following: "<font color="red">''Note: This property allocates memory for the data and it is therefore important that the data be disposed of when you are done. This is done using the Free() function.''</font>" This is the clue to what is going on: you have an XML object (hoXML is a reference to this) which you later destroy, but calling paXML has a specific (and ''documented''!!!) side effect: "<font color="red">''This property <u>allocates</u> memory...''</font>" (which, IMO, makes it a function/method, not a property... but then I'm picky!) - and into that memory it then <u>copies</u> the XML of the object it was called on (although the documentation does not explicitly state this, it does clearly imply it), so it is independent of that object and does not disappear when you "Destroy" it, which is why you need to manually "Free()" the memory when you are done. HTH.


: I don't think the example you describe would work the way you want - it would return the integer object ID of the XML object you created, which I'm guessing is not your intent!  [[Image:Sad.jpg]] --[[User:Mikepeat|Mike]] 15:38, 15 January 2009 (UTC)
: --[[User:Mikepeat|Mike]] 15:38, 15 January 2009 (UTC)


== I believe using JSon is a much better match. ==
== I believe using JSon is a much better match. ==