by konsta » Wed Sep 13, 2006 5:04 pm
Hmm, my problem with try/catch is that I'm still getting an method-terminating error when I use it (a bizarre one, in fact, I'm getting an out-of-bounds array reference when I am at j = 2 while looping through an object whose associative array has a length of 40.
I have not tried .toString() for converting numbers to strings (since loosely typed languages do that for me). I usually use .toString() to identify a variable's type (e.g. string, integer, object, etc.).
Perhaps you can help me in my ultimate goal, which is to loop through all objects in a solution to find out their properties (both names and values). If anyone has an idea how I can (programatically) get all the methods/functions as well, that would be great.
When I have used JavaScript techniques that have worked in different environments, I get errors. For example, I can't seem to pass a form as an argument to a global method - to get around it, I pass the form name and access the form inside the method by referring to it via forms['name'].
This approach only takes me so far, as I try to iterate through a form's properties using the same approach (e.g. object[propertyname]), I invariable run into an error of one type or another. First I tried checking to see if the property is null before printing it in the loop, which seemed to work sometimes, but still didn't solve the error problem. Then I attempted to use try/catch, which just created another error (this time, one I can't seem to understand, as I explained above).
Perhaps what I am trying to do is not possible without writing a plugin. At the end of the day, what I would like to see is a complete description of the objects in the Servoy Object Model. Once I have this (or rather, know how to get it, I should be able to get a listing of all the objects and their values in a solution).
If it would be helpful, I am happy to post the code I am using for this as well as the output that gets produced.
Again, any guidance is much appreciated.
---Andrew
P.S. I am using the CRM app provided with Servoy as my testbed.