• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
put cdb_list(tTable,tTarget,tKeys) into tOutputA
#1
I am having trouble using the cdb_list with the target "local"
The target "Cloud" works perfectly.

code tested:
on mouseUp pButtonNumber
local tMyVenueList
getVenueList1
put tMyVenueList into field "sourceList"
end mouseUp

command getVenueList1
local tTable, tTarget, tKeys, tOutputA, tMyVenueList
--local tMyVenueList
cdb_loadTable "venues"
put "venues" into tTable
put "local" into tTarget
put "VenueName" into tKeys
put cdb_list (tTable,tTarget,tKeys) into tMyVenueList
-- put "Not Assigned" & return before tMyVenueList
-- put "All Venues" & return before tMyVenueList
--answer gMyVenueList
end getVenueList1

I even did a reload of a table to make sure the table was loaded.
  Reply
#2
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

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
  Reply
#3
thanks, Linda. I'll give that a try tomorrow.

I couldn't wait, so I tried both code snippets.
neither worked using the Local parameter.
what could I be doing that is wrong?
I have other "local" target parameters in other code snippets that work.
  Reply
#4
I did more testing and thank you for the suggestions, BUT:

the folwing code works:
__________________________________________________________________________________________________________________________________________________________________________________
on mouseUp pButtonNumber
  -- code
  local tTable, tTarget, tKeys, tOutputA

put "test - venueData" into tTable
put "cloud" into tTarget
put "venueName" into tKeys
put empty into field "sourceList"
put cdb_list(tTable,tTarget,tKeys) into field "sourceList"

put cdb_result("recent")
end mouseUp
_________________________________________________________________________________________________________________________________________________________________________________

the following code does not
on mouseUp pButtonNumber
  -- code
  local tTable, tTarget, tKeys, tOutputA

put "test - venueData" into tTable
put "local" into tTarget
put "venueName" into tKeys
put empty into field "sourceList"
put cdb_list(tTable,tTarget,tKeys) into field "sourceList"

put cdb_result("recent")
end mouseUp
_________________________________________________________________________________________________________________________________________________________________________________

"This is not Logical" as Mr. Spock would say.
The reason that I use the cdb_list command is that it gives me a single key result for my list.
I could use a simple cdb_read command but then I have to hide the first column of my list to get a simple list.

I am sorry for being such a pain, but the documentatio shows that this could be done.
  Reply
#5
If you can upload a zipped attachment of your code that includes cdb_list not working with "local" as the target, I can take a look a closer look at your issue.
  Reply
#6
I created a Substack from one of my test card.
This substack works in my application because all of the tables are available there.
It also uses the Cloud as the parameter, so it works. Changing the parameter to local will make it fail.

it may be best to use a sharing application such as TEAMS for you to veiw the problem.
  Reply
#7
Hi Clarence,

I tested cdb_list and I got the expected results. on preOpenCard I call cdb_auth, cdb_loadTable, and cdb_sync (if you don't sync the table down "local" calls won't work). Can you try this and let me know what you get?
  Reply
#8
yes, that was bog bobo on my part. I didn't sync down from the cloud. Sometimes I forget the simple things.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)