Auto-Complete Examples
Updated and Reviewed August 2010
The following two examples illustrate valid setdef formats which sent back to INFLD in response to exitcode 30 or 31. Note that for the initial call to INFLD, you would normally set setdef to ""(unless you wanted the list displayed immediately).
Simple example:
SETDEF = "1~7~x~S~~~,ACME ,Adams ,Affleck,Azure ,,"
The above setdef string does not contain an optional [widthspec] and instead starts with a simple column definition (Coldef) string defining a single column of seven characters. The coldef string is normally (in standard XTREE usage) terminated by two tildes (~~), but in the context of INFLD auto-complete, a third tilde (~~~) is required to act as a delimiter between the coldef and the actual list items. Also note the trailing spaces on the list elements to give them each 7 characters. Finally, following the coldef string and the three tildes, we show four entries in the list, each delimited by a comma and space-padded to seven characters. Note that as with a standard setdef List of Valid Inputs, the first character of the list specifies the list item delimiter (comma in this example), and two delimiters mark the end of the list.
More complex example:
SETDEF = "[+3]0~0~x~H~RGBbg=220,230,240,A~~1~10~x~S~~11~1~x~bH~~~" &
+ ",Apples A,Bananas ,Peaches A,Watermelon ,,"
In the above list, we started with a [widthspec] of "[+3]" so that the dropdown list would be 3 grid-columns wider than the field. Then we used a more complex Coldef string to define an RGBbg value associated with a pseudo-column, plus 2 real columns - the first ten characters long (the primary column) and the last one character to contain the color code. The list then specifies the color code "A" for Apples and Peaches, so those two items would appear in the auto-complete list with the specified background color. Note that each item in the list (as measured by the space between the delimiters) must match the total length of all the real columns (11 in this example):
See the sample programs INFAC1 and INFAC2 in EXLIB:[908,41] for more complete examples.