Hello, I would like to know if it was possible in LotusScript to know if a method exists for a given object.
A function like this would be great :
Dim myObject as Object
myObject = New Object
Dim aMethod as String
aMethod = “toString”
If methodExists(myObject, aMethod) then
MsgBox "Method exists"
Else
MsgBox "Method does not exist"
End If
Thank you !
Subject: That’s a compiler task, right?
I mean, you wouldn’t have been able to save a call to a function that doesn’t exist.
sounds like what you really want is a script browser. Teamstudio.com has a free script browser, which will help you on custom classes… There is always the designer Object model GUI for Notes Classes.
Code to check for the existence code… interesting.
rich
Subject: RE: That’s a compiler task, right?
I know this tool and I use it already. My goal is to know if a method exists for a given object in the code execution. I need it for an object named “Vector”. This object has an Implode method like this :Function Implode(separator as String) As String
But this vector stores simple data types like String, Long, etc… but also user defined classes and other objects. The problem is that I can’t know if objects contained by this Vector own a “ToString” method. If I can know that and if the object has a “ToString” method, I would like to call it in my Implode method.
And, today, I have no definitive answers about that…