For loop in Lotus Script
Posted on 2004-08-16
Hi , Need some help on a 'for loop' in LotusScript.
I'm reading values from one form and updating them into another form.
The first form has a text field named TotalMANs. The value in this field can be between 1 to 175.
Also there are 175 other fields in the form which are called as MAN1 , MAN2 , MAN3, MAN4, MAN5, MAN6, UNTIL........ MAN175
Lets say I'm referring these fields in my agent as doc.TotalMANs, doc.MAN1, doc.MAN2, doc.MAN3, doc.MAN4, UNTIL..............doc.MAN175
This is what I want to do now:
If the doc.TotalMANs value is 5 Then
I want to read values from doc.MAN1, MAN2,MAN3,MAN4,MAN5 and append it in another field from a different form (doc2.MAN which is a multi-value field).
Similarly If the doc.TotalMans value is 100 Then
I want to read values from doc.MAN1, MAN2.. until doc.MAN100 and append all these values to doc2.MAN.
So the loop should run based on the doc.TotalMans value.
I know I've to write a for loop for this.