I am quite new to Livecode, so I face some problems even with basic staff.
I loading a csv into a field, now I need to get the 5 lines of this field and set them as labels of 5 buttons.
1st Problem: when I get item 1 it gives me the 3rd row of my field
2nd Problem: I can not get any other data except this second row.
Thanks In advance
Code: Select all
on mouseUp
local tFile
answer file "Select the File to load:" with type "semicolon Separated Values|CSV"
put it into tFile
if tFile is empty then
exit mouseUp
else
put URL ("file:" & tFile) into field "fileIn"
replace ";" with tab in field "fileIn"
put item 1 of field "fileIn" into tVariable
set the label of button "Super 1" to tVariable
put item 2 of field "fileIn" into pVariable
set the label of button "Super 2" to pVariable
put item 3 of field "fileIn" into kVariable
set the label of button "Super 3" to kVariable
put item 4 of field "fileIn" into mVariable
set the label of button "Super 4" to mVariable
put item 5 of field "fileIn" into nVariable
set the label of button "Super 5" to nVariable
put item 6 of field "fileIn" into tVariable5
set the label of button "Super 6" to tVariable5
end if
end mouseUp