08-30-2019, 12:40 AM
I have confirmed that cdb_list is working with the target parameter "local."
Here are two methods you can try with the code you provided: placing cdb_list into a global variable or changing getVenueList1 to a function and returning cdb_list.
1) Using a global variable
2) Changing getVenueList1 to a function
Here are two methods you can try with the code you provided: placing cdb_list into a global variable or changing getVenueList1 to a function and returning cdb_list.
1) Using a global variable
Code:
global gMyVenueList
on mouseUp pButtonNumber
getVenueList1
put gMyVenueList into field "sourceList"
end mouseUp
command getVenueList1
local tTable, tTarget, tKeys
cdb_loadTable "venues"
put "venues" into tTable
put "local" into tTarget
put "VenueName" into tKeys
put cdb_list(tTable,tTarget,tKeys) into gMyVenueList
end getVenueList1
2) Changing getVenueList1 to a function
Code:
on mouseUp pButtonNumber
put getVenueList1() into field "sourceList"
end mouseUp
function getVenueList1
local tTable, tTarget, tKeys
cdb_loadTable "venues"
put "venues" into tTable
put "local" into tTarget
put "VenueName" into tKeys
return cdb_list(tTable,tTarget,tKeys)
end getVenueList1