Text List Programming

I am discovering a whole lot of power in Text Lists, and the very first example in Help topic Text List Programming opens a new world. But I’m missing some key information to make it work for me. The first example shows how to extract a particular value from a certain column in the currently highlighted line, using the tabarray( function. The example array to be extracted from is called “destinationChoice” and is described as “the field or variable that was set up for the text list selection.” I assume this means the very first entry point in the Text List Options pane: Selected Value. I have put a variable name there, expecting it to be used as the first tabarray( argument, but my procedure that is trying to use it just returns “variable has no value”.

So 2 questions: is this the place where the tabbed array in my Text List gets its name? If not, where?
That is actually one question; my other one is: when a previously unknown variable name is entered into such a form field that is expected to contain a fileglobal variable, when does that variable become defined and given a value? Initially the error I was getting was “variable does not exist”; when I declared it in the procedure itself, the error becomes “variable has no value”, so I haven’t solved anything.

When you click on a line in the Text List, the content of that line gets put into the variable you designated as the selection value. That variable won’t have a value until you actually make a selection.

The array in your text list will normally be carriage return separated, unless you specified some other character. If the text list builds its array from a database, the array won’t have any name at all. If it is displaying an array in a variable that you put there with an ArrayBuild or something, then the name of that variable will be the name of the array.

If your text list is setup to display columns, then each row will be a tab separated array. Clicking on a row will put that row into the destinationChoice variable, and then you can use tabarray( to extract one element from that tabbed array.

Yes, that’s correct. This variable is created automatically when the form switches from graphics mode to data mode, or when the form is opened. It is assigned to a value when you click on an item. However, this value is not set up or updated if the Database Navigation option is enabled. I think that must be what you are doing. This is described on the Text List Database Integration page. As described on that page, when the Database Navigation option is enabled you can simply use the database fields themselves to identify the position in the database, just as you would in the data sheet.

Bingo! That option is set to “on” by default, and I paid no attention to it. Unchecking it makes everything work. Thank you for the explanation of how the variable is activated; that is what I assumed but my current situation led me astray.

One more. Is there a way to make the data in any particular column of a Text List stand out, like with color or bold or a different font? I’d like to be able to make a column that will respond to a click (see above) make itself obvious to the user. I have turned Rich Text on, and have put a color:66AA66 tag in the same place I use width: and align: but it is ignored.

The tag must not be in the the correct place. Tagging a particular column is definitely possible. There is an example of this in the Text List Appearance page of the help, it’s the last example at the bottom of the page.

Yes. Not even close. It works now.

The documentation is good. But one must know where to look and it’s not always obvious when the whole environment is new.