Xbasic

A5_OPEN_DEFAULT_BROWSE Function

Syntax

P a5_open_default_browse(C table_set_name [,C filter [,C order [,C description [,C options [,L enable_show_all [,* arguments ]]]]]])

Arguments

table_set_name

The name of the table or set to display. Character

filter

Optional. Default = .T. (all records). A character filter expressionthat evaluates to a logical value. Selects records from the table.

order

Optional. Default = record order. A character order expressionthat sorts selected records.

description

The description that you assign to the query that Alpha Anywhere creates when the browse is opened.

options

Optional. Default = Record order, ascending, not unique. Controls whether Alpha Anywhere uses an index, a new query list, or an existing query list to satisfy a query. This string can contain one or more of the following codes:

Code

Description

N

Builds a query list even if an index matches the query definition.

D

The descending order option puts the records in descending alphabetical order or, for a numeric field, from highest to lowest value.

T

Temporary query. Alpha Anywhere will automatically delete this query if necessary if building a new query would cause it to run out of query slots. there are a maximum of 16 query slots.

U

The unique option includes only unique records in the query list.

M

Builds a new query list even though a) an existing query list exists, and b) an existing Index exists (both of which, Alpha Anywhere could have used rather than running a new query).

X

Use an index even if an existing query exists (which Alpha Anywhere would otherwise have used in preference to the index).

I

The I flag is obsolete. It was used by Alpha Five V1 to indicate that the index should be case-insensitive. However since V2, Alpha Anywhere automatically builds all indexes as Case-insensitive. It is documented because in some situations, the Script Recorder will show Xbasic code that includes the "I" flag.

enable_show_all

Logical. Optional. Default = .F. Specifies whether the Show All icon that appears on the toolbar is enabled. .T. = Icon enabled, .F. = Icon not enabled.

arguments

*

Description

The A5_OPEN_DEFAULT_BROWSE() function displays the default browse for the selected table or set.

If you specify an optional filter and order, you can give the query a description (which shows up when you press Control I to display the index selector). options are the standard options that apply the to .query_create() method. If you do not want the user to remove the filter/order that you specified for the default browse, you would want Show_Allicon to be disabled. otherwise the user could press the icon and remove the filter that you specified.

Example 

The following displays all the entries from the Customer table where the lastnamefield starts with the letter M or greater. The entries are also ordered by lastname.

a5_open_default_browse("customer", "lastname > " + quote("M"), "lastname")

Limitations

Desktop applications only.

See Also