So, working on calling a Javascript from C#. Got that working, but then suddenly out of nowhere comes an error
within the Javascript I found. It’s an XML parser.
return tSystemData.ToBuiltin(Hashtable);
Error is a conversion from Array to Hashtable, where tSystemData is obviously the array.
Don’t know how this manage to work for the guy who originally made it. >.>
Unity 3.4 has an upgraded javascript engine which is not 100% compatible with previous one. Try importing Boo.Lang and see if it helps. Also, can you copy-paste the error here, so we could really know how to fix it
That didn’t fix it. Well, here’s the code. I’m not to familiar with Javascript, I do everything in C#.
function ParseString (aXMLString : String) : Hashtable[] {
// Initialize the system data array
var tSystemData : Array = new Array();
// Look for and remove the XML header tag
aXMLString = RemoveXMLHeaderTag(aXMLString);
// Pull the configuration data
var tConfigData : Hashtable = GetElementAttributes(aXMLString, "system");
tSystemData.Push(tConfigData);
// Look for and remove the wrapping system tag
aXMLString = RemoveSystemTag(aXMLString);
// Process all body tags
var tNextBody : Hashtable = GetElementAttributes(aXMLString, "body"); //GetNextBody(aXMLString);
while (tNextBody != null) {
// Add the body to the system data array
tSystemData.Push(tNextBody);
// Strip the current body tag
aXMLString = RemoveBodyTag(aXMLString);
// Look for the next body tag
tNextBody = GetElementAttributes(aXMLString, "body");
}
// Return the system data array as a builtin array
return tSystemData.ToBuiltin(Hashtable); // ERROR is here.
}
Actually I dont understand what tSystemData.ToBuiltin(Hashtable) should be doing, so I couldn’t help with that. What is the console output (error message)?
The documentation states that Lists of Lists and Arrays of Arrays are not supported. Since Hashtable derives from Collection my guess is that it falls into that category.