Can a LotusScript Function be Designed to Return an Array?
I don't know if I really wanted to post this due to content, or I just loved the fact that a KnowledgeBase item actually used the word "funky"...
Can a LotusScript Function be Designed to Return an Array?
Document Number:
1090574
Problem
Can a LotusScript Function be Designed to Return an Array?
Content
LotusScript functions are designed to return a scalar value, a Variant
or an object reference. An array can be returned using a Variant.
This can be done by either indicating "As Variant" or
leaving it blank as variant is the default return type.
For example, either of the below will cause the function to return a Variant
value:
Function Funky(a As String, b As String) As Variant
Function Funky(a As String, b As String)
Code example:
Given the function supplied below, the value of the result variable will
be an array: result(0)="parta", result(1)="partb".
Sub Initialize
result=Funky("parta", "partb")
End Sub
Function Funky(a As String, b As String) As Variant
Dim cc(0 To 1) As String
cc(0)=a
cc(1)=b
funky=cc
End Function



Comments
Using this I encountered one problem: returning an "empty" array, an array that is accepted by the forall loop and skips it .
I already posted it here: http://www.looseleaf.net/Looseleaf/Forum.nsf/8178b1c14b1e9b6b8525624f0062fe9f/80f66b0fada62ca585256e310048e05c?OpenDocument
Do you have any suggestions?
Posted by Jasper Duizendstra At 07:02:57 On 17/02/2004 | - Website - |
Posted by Duffbert At 19:32:15 On 17/02/2004 | - Website - |