MullinRJ Posted October 8, 2019 Share Posted October 8, 2019 Does anyone know were a list of XML errors may be published? The following script was copied from the Developer Wiki from the VS:WriteXMLMemory() page. I modified it to trap any XML error generated along the way. On my computer running VW 2019 it generates an error for WriteXMLMemory(). The error is -21. Even with the -21 error, the function writes a value to variable "mem" which I display at the end of the program regardless of any errors. PROCEDURE test; VAR xml : LONGINT; err : INTEGER; mem : DYNARRAY OF CHAR; value : STRING; BEGIN mem := ''; xml := InitXML; err := CreateNewXMLDocument(xml, 'root'); if (err = 0) then begin err := SetElementValue(xml, '/root/value', '34'); if (err = 0) then begin err := WriteXMLMemory(xml, mem); if (err = 0) then AlrtDialog(mem) else AlrtDialog(concat('Error= ', err, ' in WriteXMLMemory()')); end else AlrtDialog(concat('Error= ', err, ' in SetElementValue()')); end else AlrtDialog(concat('Error= ', err, ' in CreateNewXMLDocument()')); err := ReleaseXML(xml); if (err <> 0) then AlrtDialog(concat('Error= ', err, ' in ReleaseXML()')); { Show value of variable "mem" w/ or w/o XML errors } AlrtDialog(mem); END; RUN(test); TIA, Raymond Quote Link to comment
Nicolas Goutte Posted October 9, 2019 Share Posted October 9, 2019 Would the list documented in http://developer.vectorworks.net/index.php/VS:InitXML be what you search? Quote Link to comment
MullinRJ Posted October 9, 2019 Author Share Posted October 9, 2019 Nicolas, thank you. That is exactly what I was looking for. Usually I look at the HTML and the Dev Wiki pages for calls that are confusing or under documented. I missed this one. I guess it wasn't confusing enough. Now to find out why WriteXMLMemory() seems to work, yet kicks a -21 error (Invalid XML handle). Oh the joys of programming. Again, thank you. Raymond Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.