Xbasic

KEYLIST_BUILD Function

Syntax

Output_String as C = KEYLIST_BUILD(C keylist_format,C return_value,C column1[,C column2]...)

Arguments

keylist_format

A comma delimited character string of format: Column_Number : Width [ Column_Heading ] For example: "1:30,2:20,3:15". In this example there are 3 columns of width 30, 20 and 15 respectively.

Argument
Type and Description
Column_Number

Type N. The sequence number of the column.

Width

Type N. The width of the column in characters.

Column_Heading

Type C. Optional. The column heading.

return_value

The name of the field to be returned when a record is selected.

column1

The names of the fields to display and Xdialog formatting information. The format is: Column1_expression, column2_expression, ? columnN_expression.

column2

Character

Description

Build a list of keys.

Discussion

The KEYLIST_BUILD() function returns specially formatted data for display of advanced record lists in an Xdialog form. The syntax for an advanced record list-combo box control is: %K = Table, {Keylist_Expression}{Filter_Expression}%.Size VariableName where Keylist_Expression defines the order of the data in the record list and the columns in the record list. The Keylist_Expression uses KEYLIST_BUILD() to define:.

Order of data in the record list
How many columns are displayed in the record list
The contents of each column
The width of each column
The value returned when the user makes a selection from the record list.

For more information, please refer to Learning Xdialog.

keylist_build('h=.025,1:15Lastname, 2:15Firstname, 3:20Address, 4:15City, 5:5St, 6:6Zip', lastname, lastname, firstname, address, city, state, zip)

Note : If you want to use a variable in a KEYLIST_BUILD() expression, because the KEYLIST_BUILD() function is embedded in an Xdialog definition, the resulting code must be structured like the following.

dim dialog_code as C
dialog_code = <<%dlg%
...xdialog code...
keylist_build(...
%dlg% + variable + <<%dlg%
...)
...xdialog code...
%dlg%
ui_dlg_box("Title",dialog_code,<<%code%
...event handling code...
%code%)

See Also