Question on arrays

I’m working on a script that exports data to a txt file for use by another application. Some lines of text in the file are contingent on certain field values in the Notes document(s).

My question is, how do I scroll through an array of values, and extract each element of the array to write the value somewhere else in the text file?

For example, Field1 is a textlist that has four values. It would look something like:

Field1(0)

Field1(1)

Field1(2)

Field1(3)

How do I grab each value for use elsewhere in the code? For example var1 = Field1(0), var2 = Field1(1) etc.

I hope this makes sense, and thanks in advance for your repsonse.

Subject: Question on arrays

If you’re using Lotus Script to produce the file you could loop through things:

For x=0 to ubound( doc.FieldName )

print #1, doc.FieldName(x)

Next

Subject: Question on arrays

you can use ‘forall’

forall x in Field1

’ x is the value of each array element.

if any problem use cstr(x) and use it.

’ write the code here to process further with the value

End forall

or

For i = 0 to Ubound(Field1)

Field1(i) will have the array element value

 'write the code here to process further with the value

Next

Subject: Question on arrays

You can use the explode function too.

Implode(sourceArray as Variant, [delimiter as String]) as String