Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating LotusScript formulas with Optional Parameters

Status
Not open for further replies.

MoGryph

Programmer
Nov 1, 2000
99
US
Does anyone know if there's a way to create a function in lotusscript, that allows for an optional parameter.

Take for example, something like the Mid$ function.

As defined in Help, it's syntax is:
Mid[$](stringVar, start [, length]) = stringExpr

In other words, you may, or may not, include the Length of the characters you want returned.

I know in VB and VB for Apps, you can use the actual 'Optional' keyword in the function declaration, to say that it is an optional. Something like:

Function TestOpt$(stringVar As String, OPTIONAL StringVar2 As String)
TestOpt$ = stringVar & IIf (Not(IsNull(StringVar2)), StringVar2, " None")
End Function

Yes, very useless example, but I think it explains what I'm looking for.

Thanks-
MoGryph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top