Xbasic

UI_GET_RANGE Function

Syntax

Range_Expn as P = ui_get_range([L top_level_only [,L flag_external_tableset [,C external_tableset_name ]]])

Arguments

Range_Expn

A pointer to a dot variable that contains the current filter and order expressions.

Argument
Details
.error_message

Type "C", Any error message generated by the dialog box.

.filter

Type "C", The filter expression that the operator defined. See Query.Filter

.flag

Type "L", The sort values that the operator defined. See Query.Options.

.lastbutton

Type "C", The button that the operator pressed in the dialog box.

.order

Type "C", The order expression that the operator defined. See Query.Order.

.Xbasic.filter

Type "C", Process this Xbasic statement with EVALUATE_TEMPLATE()to apply the filter expression defined by the operator.

.Xbasic.order

Type "C", Process this Xbasic statement with EVALUATE_TEMPLATE()to apply the order expression defined by the operator.

top_level_only

Optional. Default = .F.

.T. = Top level table of set.
.F. =
flag_external_tableset

Optional. Default = .F.

.T. = The query is against an external table or set.
.F. = The query is against a local table or set.
external_tableset_name

Optional. The name of the external table or set.

Description

The UI_GET_RANGE() function displays the Select Filter dialog box to help the user select a filter or range for the current table or set.

images/UI_GET_RANGE.gif

Example

? ui_get_range(.f.)
= error_message = ""
filter = "between(recno() ,2,6)"
flag = .F.
lastbutton = "ok"
order = "recno() "
Xbasic = query.filter = "between(recno() ,2,6)"
query.order = "recno() "

If you need to define filter or order expressions for a table or set that is not currently open, use a variation of this script, which retrieves the filter and order information for the invoice set.

code = <<%code%
dim s as P
dim filter as P
s = set.open("invoice.set")
filter = ui_get_range()
if filter.lastbutton = "OK" then
ui_msg_box("", filter.filter)
else
ui_msg_box("", "user cancelled")
end if
s.close()
%code%
evaluate_template_private(code)

Limitations

Desktop applications only.

See Also