ashik1
asked on
Dynamic Arrays in LotusScript
My question follows on from the code below:
Dim sendTo(1 to 2) As String
sendTo(1) = "person_name1"
sendTo(2) = "person_name2"
Call doc.Send(True, sendTo)
How do I re-write the above code so that the "sendTo" array can be declared dynamically (e.g. 1 to n) and so enable sending to more than 1 recipient but will work if we don't know how many recipients there are.
The recipients' names will be taken from a field (e.g. distribution list) with names separated by comma (,).
Can this be done?
Dim sendTo(1 to 2) As String
sendTo(1) = "person_name1"
sendTo(2) = "person_name2"
Call doc.Send(True, sendTo)
How do I re-write the above code so that the "sendTo" array can be declared dynamically (e.g. 1 to n) and so enable sending to more than 1 recipient but will work if we don't know how many recipients there are.
The recipients' names will be taken from a field (e.g. distribution list) with names separated by comma (,).
Can this be done?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can dynamically alter the size of an array with the ReDim (redimension) statement. For example, the following statement will expand the upper index of your sendTo array to 10:
ReDim sendTo(10)
Your code needs to determine the number of recipients required and then ReDim the array to that number.
ReDim sendTo(10)
Your code needs to determine the number of recipients required and then ReDim the array to that number.
ReDim sendTo(10)
Your code needs to determine the number of recipients required and then ReDim the array to that number.