I created 2 functions.
The first reads the content of a csv file into a global Parameter, the second gives me the required row of data as a properties list for use within a repeat loop.
Seems to work ok for me. Hope this helps!
// FUNCTION1 df_GetIterativeData
// Example Call : df_GetIterativeData "TC001 Data.csv"
Params DataFileName
If DataFileName does not contain ".csv" Then
Set DataFilename = DataFileName & ".csv"
End If
If Global DataFilePath Is Empty Then
df_GetDataFilePath
End IF
Put Global DataFilePath & DataFileName Into DataFilePathName
Log DataFilePathName
Repeat For Each Line Of file DataFilePathName
Add 1 To RowCount
Put It Into Item RepeatIndex() Of Global IterateData
End Repeat
Set Global NumDataRows = RowCount - 1
//FUNCTION2 df_ReadInIterativeDataRow
// Example Call : Repeat Global NumDataRows Times
// Put RepeatIndex() Into IterCount
// Put df_ReadInIterativeDataRow(IterCount) Into TestData
// log TestData.FirstName etc ...
Params DataRow
// Resolve Delimitter
If "DataFileDelim" is among the keys of Global GParams Then
Put Global GParams.DataFileDelim Into DelimChar
Else
Put ";" Into DelimChar
End If
// Get the data
Put The First Item Of Global IterateData Into DataRefs
Put DataRow + 1 Into DataRowRef
Put Item DataRowRef Of Global IterateData Into DataValues
Put DataRefs split by DelimChar Into SplitDataRefs
Put DataValues split by DelimChar Into SplitDataValues
Repeat For Each Item In SplitDataRefs
Put Item RepeatIndex() Of SplitDataRefs Into DataRef
Put Item RepeatIndex() Of SplitDataValues Into DataVal
Set PropDataList = PropDataList & "," & DataRef & ":" & quote & DataVal & quote
End Repeat
Delete First Occurrence Of "," From PropDataList
Set PropDataList = "(" & PropDataList & ")"
Put PropDataList as a property list into ReturnData
Return ReturnData