LotusScript

Hi

A question regarding LotsScripts command ‘Call’!

Do i have to use it? What is her purpose?

Example:

uidoc.FieldClear does the same like Call uidoc.FieldClear?

And one more:

dim ws as new NotesUIWorkspace

Why must we use new?

Thanks

Subject: LotusScript

Hi A question regarding LotsScripts command ‘Call’! Do i > have to use it? What is her purpose? Example:

uidoc.FieldClear does the same like Call uidoc.FieldClear?

You don’t have to use Call. As far as I can tell, it’s basically redundant (there’s nothing you can do with Call that you can’t do without it). It simply provides an alternate syntax to call a sub or func. From what I’ve seen people either avoid it entirely, or use it religously to ensure that all sub/func calls look the same (i.e. always have parameters wrapped in parentheses regardless of whether the routine returns.

I’d recommend following that line of reasoning: either use it or don’t, but at least be consistent.

And one more: dim ws as new NotesUIWorkspace Why

must we use new? Thanks

New indicates you wish to create a new instance of this class and assign it to the variable you’re declaring (standard OO instantiation stuff).

HTH,

Dave.

Subject: LotusScript

I think you only need to include ‘Call’ when passing parameters via ().

Subject: LotusScript

To go into the other side of your question… about the “New” keyword:

New is used to create an instance of a class. In this case, the NotesUIWorkspace object. In the designer help, look in the index under New keyword. There is a help document titled Working With Object Reference Variables as well as other documents. This is an OOP thing. You are creating an instance of the LotusScript object you want to work with.