I’m having some trouble with a text list. I’d like for it to display an array of a single field from each of the selected records in the database. Using ArraySelectedBuild in the formula pane as shown repeats the first selected record’s address 5,718 times, even when only 6 records are selected. Setting the procedure pane to display that formula in a message correctly shows the six selected record’s Address field values, so the formula itself seems to be ok. (ArrayBuild similarly displays only the first Address, but it’s the first one in the db, as opposed to the first one in the selection.)
I’ve also put the result of the arrayselectedbuild into a variable, but that won’t display, either. I’ve learned I can fill the query box with info(“visible”), and that will show only selected records, but I’m curious as to why the List Object won’t display either a formula or variable that generates a simple array?
You’ve selected ~
in the Database option (thank you for providing the screen shot). This tells the object to run the formula over and over again for each record in that database. I’m guessing that you have thousands of records.
You have a couple of options. Probably the simplest would be to make the Database option blank. Just click on it and use the delete key.
The other option would be to leave Database set to ~
change the Formula to just Address, and change the Query to info("visible")
. Actually, that’s pretty simple as well - oh, in fact re-reading your question you already figured this out.
I’ve always felt that a checkbox for the Query would be a nice way to accomplish that versus the number of times I’ve been stalled with the same problem when I’ve inadvertently omitted it.
Ha! I must have tried that a half-dozen times… bupkus. After your suggestion I tried it again and - voila!
Thanks, guys!
Ok… on to the next task. How do I update the Text List? That is, how do I force a refresh of the arrayselectedbuild( formula result when the selected records change? Going to Graphics mode, and clicking on the blank Database option, followed by a carriage return works, as does clicking into the formula pane, as if to edit, then exiting. I’m hoping for something a little smoother. ; ) Although not mentioned in the objectaction docs in “Text List Progrtamming”, I tried
Objectaction “PropertyPicker.TL”, “FillList”
to no avail, of course, but I’ve not found a command or other action that works, either, including “Show”, “ShowPage”, “Showvariables” (when the variable was in formula pane). Can Text List objects be refreshed on command?
You were on the right track with showvariables. However, I imagine that the variable you used was in a quoted formula. That makes the variable “invisible” to showvariables.
The solution is to make a dummy variable and include it in the formula, for example:
catcherror("",updateList)+arrayselectedbuild(...
Then you can update the Text List with this code:
showvariables updateList
Note that this technique will work with any kind of graphics object, not just Text Lists.