I'm building an app that saves the users default settings / preferences in an SQL table. The table contain things such as preferred date format , region etc. The table looks something like this below
I'm using a simple repeat loop to grab the data from the table, and then I want to dynamically set the variables that are declared within it.Row | varName | varValue
1 | gLocale | E
2 | gRegion | UK
Code: Select all
put "SELECT * FROM appSettings" into tSQL
put revDataFromQuery("§",,gdbid, tSQL) into tData
repeat with r = 1 to the number of lines in tData
-- Pseudo code below
-- put item 2 of line r of tData into the variable named in item 1 of line r of tData
-- eg put 'E' into gLocale
-- eg put 'UK' into gRegion
end repeat
eg
Code: Select all
If item 1 of line r of tData = "gLocale" then
put item 2 of line r of tData into gLocale
end if
if item 1 of line r of tData = "gRegion" then
put item 2 of line r of tData into gRegion
end if
etc
Thanks,
Al.