as i learn livecode i stubled into another problem. basically i want to find a way to store information in a file and load it again when needed. for my example i made three fields (f1, f2, f3) and a save button. i put the content into an array and save it. this works. and yes i seperated the values of the fields with commas as i am too noob to know better.
i have another three fields (ff1, ff2, ff3) and a load button. i can load the file and answer is showing me the content but i struggle seperating the content and putting it into the seperate fields (ff1, ff2, ff3). so basically i would need to seperate the loaded content in my array by commas.
here is the code for the save button:
Code: Select all
on mouseUp
local tMultiArray
put fld "f1" into tf1
put fld "f2" into tf2
put fld "f3" into tf3
put tf1,tf2,tf3 into tMultiArray
## Store the fillGradient array for the graphic object in a file
ask file "Save MultiArray to file:"
put it into theFile
if theFile is not empty then
put tMultiArray into URL ("binfile:" & theFile)
end if
end mouseUp
Code: Select all
on mouseUp pButtonNumber
## Load fillGradient array from file
answer file "Select file containing MultiArray:"
put it into theFile
if theFile is not empty then
put URL ("binfile:" & theFile) into tArrayLoaded
answer tArrayLoaded
put tArrayLoaded[1][1] into fld "ff1"
put tArrayLoaded[1][2] into fld "ff2"
put tArrayLoaded[1][3] into fld "ff3"
end if
end mouseUp