Link to home
Start Free TrialLog in
Avatar of ashik1
ashik1Flag for United Kingdom of Great Britain and Northern Ireland

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?
ASKER CERTIFIED SOLUTION
Avatar of asdaprice
asdaprice

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rashaler
rashaler

The 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.
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.