Live and learn. Just posted what I think is a better solution using HTA HERE Much faster if you have lots of cells.
Code: Select all
//Clean up leftover files
Let>DFile=%temp_dir%Dialogfile.scp
Let>CSVFile=%temp_dir%DataAcquiredFromElseWhere.csv
DeleteFile>DFile
//Using LabelToVar to create a sample csv.
//Remark or delete the next three lines
//Then call your own csv file
DeleteFile>CSVFile
LabelToVar>DataAcquiredFromElseWhere,data
WriteLn>CSVFile,wres,data
CSVFileToArray>CSVFile,item
//Reducing the Item_count variable might not be needed
//It depends on how your CSV file ends. Test with and without.
Sub>item_count,1
Sub>item_1_count,1
WriteLn>DFile,wres,Dialog>Dialog1
WriteLn>DFile,wres,object Dialog1: TForm Caption = 'Iowa Birds' AutoSize = true Position = poScreenCenter
Let>EBR=0
Repeat>EBR
Add>EBR,1
Let>EBC=-1
Repeat>EBC
Add>EBC,1
WriteLn>DFile,wres,object Edit_%EBR%_%EBC%: TEdit
Let>Value={%EBC%*120}
WriteLn>DFile,wres,Left = %value%
Let>Value={%EBR%*20}
WriteLn>DFile,wres,Top = %value%
WriteLn>DFile,wres,Width = 120
WriteLn>DFile,wres,Height = 20
WriteLn>DFile,wres,end
Until>EBC=%item_1_count%
Until>EBR=%item_count%
WriteLn>DFile,wres,end
WriteLn>DFile,wres,EndDialog>Dialog1
Include>DFile
Let>Row=0
Repeat>Row
add>Row,1
Let>Col=-1
Repeat>Col
add>Col,1
Let>value=Item_%Row%_%Col%
SetDialogProperty>Dialog1,Edit_%Row%_%Col%,Text,value
Until>Col=%Item_1_count%
Until>Row=%Item_count%
Show>dialog1,r
//Sample data, use your own CSV file.
/*
DataAcquiredFromElseWhere:
Common Name,Latin Name,Sighted in Iowa
Black-bellied Plover,Pluvialis squatarola,Y
American Golden-Plover,Pluvialis dominica,Y
Snowy Plover,Charadrius alexandrinus,N
Semipalmated Plover,Charadrius semipalmatus,Y
Piping Plover,Charadrius melodus,Y
Killdeer,Charadrius vociferus,Y
*/