I need to evaluate if a certain method exists in a certain form, I tried with this code:
var formName = application.getMethodTriggerFormName(); // get the form name
if ( eval(forms[formName].method()) ) // evaluate if the method exists
{
forms[formName].method(); // run the method
}
else { ... }
It works if the method exists and if it returns true to the eval() function but it obviuosly doesn’t work if the called method doesn’t exists.
Is there another way to check if a method is there?
The issue arised from a module I’m working on, my goal is to define some default methods in the module and evaluate if there is a more specific method in the main solution at runtime, if there’s not a specific method then the default one from the module is used.
Same logic can be applied to forms:
if in the main app there is a form called [xxx] show that form otherwise remain in the current one or do {whatever}
This is quite easy by evaluating() foundset.getSize for the supposed form, maybe it will not work in every situation but it is a good starting point.
But when talking about methods I can’t find a way to check if there is a valid method with that name in that particular form.
IT2BE:
BTW, now that I think of it, bring the beer just look for somebody hanging around completely drunk and its me
Ok, I’ll keep my eyes open for a drunk developer hanging around…
And when I’ll find you someone will have to look for 2 drunks developers hangin around…