I often find it useful to call upon Notes Formula language functions from my LotusScript code. You can do this with the LotusScript Evaluate function. You can use any Notes Formula language except UI commands.
The parameter of the LotusScript Evaluate function must always be a string, and the function must return an array. Let me show you how to render Lotus Formulat language as parameters the Evaluate function accepts.
To use Lotus Formula language by itself, surround it by LotusScript delimiter character"|" in the LotusScript Evaluate function.
In this example I use the Formula language @Name and @Username functions to display the common name:
Dim tempchoice as variant
tempchoice = Evaluate (| @Name([cn];@Username) | ) ' Returns an array
Msgbox Cstr(tempchoice(0))
To combine Notes Formula language with a LotusScript variable, put the Formula language function between "|" characters, and the LotusScript variable between "| &" and "& |".
In this example I display the IBM character set from 51 to 100:
Dim num As Integer
Dim returnanswer As String
Dim tempchoice As Variant
For num=51 To 100 Step 1
tempchoice = Evaluate (| @Char( | & num & | ) | ) ' returns an array
returnanswer = returnanswer +Chr(10)+ Cstr(num) + "- " +Cstr(tempchoice(0))
Next
Msgbox Cstr(returnanswer)