Record List - List Box Control Syntax


[%KL= Index_Query_Name % [. Width [, Height ]] Variable_Name [ ! rl_* ][ ? Enabled ] ]

[%@ FormatVariable % [. Width [, Height ]] Variable_Name [ ! rl_* ][ ? Enabled ] ]



Character. The name of the index or query ( query.description ).


>Character. When combined with "@" allows the control to read its formatting instructions from the variable named FormatVariable.


Numeric. The width of the control.


Numeric. The height of the control.


>Character. The name of a character variable to receive the user selection, or a numeric variable to receive the index value of the selected radio button. The index of the top-most button is 1. An initial NULL value places the selection line at the top of the list. When Variable_Name has a value found in the list, the selection line will be placed on that value.


>Character. Optional. See Event Syntax.


Logical. Optional. See Enabled Syntax.


The Record List - List Box Control provides a dynamic view of selected records and fields from a table or set.

You must not have any space characters in the finished command.


For example, the following script creates a list box 50 characters wide and 10 lines tall based on the query named "Keylist" ( query.description ):

tbl = table.reset("clients")
query.order = "lastname+firstname"
query.filter = ".t."
query.description = "Keylist"
indx = tbl.query_create()
ui_dlg_box("Simple Record List",<<%dlg%
Print a mailing label for which customer?;
Select customer lastname:;
<*15&OK!ok> <15&Cancel!cancel>
if a_dlg_button = "ok" then
filter_expression = "lastname+firstname = '"+key_selected+"'"
end if
images/XD_Record List box.gif

Macro Expansion Symbol

If you created an Xdialog with a record list list box, you would typically use this syntax.

ui_dlg_box("Alpha Anywhere",<<%dlg% 
[%kl=customer,{keylist_build("H=.025,1:25Customer_Id,2:25Firstname,3:25Lastname,4:25Bill_State_Region",+Customer_id,left(+Customer_id,25),left(+Firstname,25),left(+Lastname,25),left(''+Bill_state_region,25))}{Bill_state_region = "ma"}"%.100,10rl]; 

You will notice that the syntax for the record list is %format string%.100,10rl. This creates a record list that is 100 columns wide, and 10 lines high. The format string that defines the record list is:

kl=customer,{keylist_build("H=.025,1:25Customer_Id,2:25Firstname,3:25Lastname,4:25Bill_State_Region",+Customer_id,left(+Customer_id,25),left(+Firstname,25),left(+Lastname,25),left(''+Bill_state_region,25))}{Bill_state_region = "ma"}"

If the control definition is written as %@formatStringVariable%.100,10rl, then Alpha Anywhere sees that the format definition for the control ( all controls on an Xdialog have an optional format specification that is contained between pairs of % signs) is @formatStringVariable. The @ tells Alpha Anywhere that the format string is not defined here directly, but instead by a variable called formatStringVariable, and to evaluate that variable to get the actual format string. There are a limited number of places in an Xdialog format string where the @ (macro expansion) symbol is recognized. Record list controls are one of those places.

See Also