Clean For Next and For All loops

This document shows you two ways to loop all the values of an array notesitem or doc field containing multiple values.
LotusScript


Dim CostCenters As notesitem
Set CostCenters = doctemp.GetFirstItem("ExpDlg_CostCenters")	'Multi-valued field
Dim CurrentCode As String

ForAll R In CostCenters.Values
	CurrentCode = R
	Msgbox R
End ForAll
	
For J = 0 To Ubound(CostCenters.Values)
	CurrentCode = CostCenters.Values(J)
	Msgbox CostCenters.Values(J)
Next J	

Posted by fbrefere001 on Monday June 24, 2002