I have a Windows form with 12 label controls which I want to populate with information I have stored in an Array. What I have currently is the following:
method-id TPS0010DForm_Load final private.
procedure division using by value sender as object e as type System.EventArgs.
set lbl1::Text to LineArray(1)
set lbl2::Text to LineArray(2)
set lbl3::Text to LineArray(3)
goback.
end method.
I suspect that a better way to do this would be roughly as follows:
method-id TPS0010DForm_Load final private.
procedure division using by value sender as object e as type System.EventArgs.
perform varying the-index from 1 by 1
until the-index > 12
set lbl(array-item)::Text to LineArray(the-index)
compute the-index = the-index 1
end-perform
goback.
end method.
But I do not know how to make my labels into an array (set lbl(array-item)::Text). I have another screen that has about 100 labels and so I would not want to write 100 lines just to move information from an array into each label. I want to do it in a loop.