Saturday, September 14, 2013

Obtain class name of objects in lotusscript

Several months ago, I explored how to create overloaded functions in Lotusscript. I had posted about the same as well. Recently I went through a thought which required me to find a way to get the class name of a lotusscript object in the run time. It really took me some time to eventually recollect that I knew the answer already until I went through my own posts again.

Thought I would make it simpler with a proper titled post dedicated for this issue of finding the class name of a lotusscript object on run time.

The lotusscript key word that does it is "TypeName". Though I had used this for doing the overloaded functions, It took me an hour to recollect it X(. Guess I had grown rusty in the last two years with less coding. Am happy now, that I get enough stuffs to challenge my skills again

In short, following is a little illustration about the way this keyword works. For a quick test, add the following code to a button and test it on Notesclient.

dim doc as NotesDocument
dim uiDoc as NotesUIDocument

msgbox TypeName(doc)
msgbox TypeName(uidoc)

Now when you click on the button, you will receive a couple of prompts saying
"NOTESDOCUMENT" and "NOTESUIDOCUMENT"


No comments:

Post a Comment