OrderTable() generate/enh74c.jpg


Returns or sets the sort order and order name of a selected database.

Syntax

OrderTable([cOrderName|nOrderNumber]) --> { nOrder, cSortName }

Arguments

<cOrderName|nOrderNumber> --> If specified this is the order name to specify or the order number.

Returns

Returns an array containing two elements:

<nOrder> --> is the current index sort order of the table. This is a numeric value. If there is no current index sort order this value will be zero.

<cSortName> --> the name of the index sort order of the table. This is a character string. If there is no current index sort order this value will be an empty "" string.

Description

This function sets or returns the index sort order and index sort order name of a selected database. It is useful if you need to change the sort order of a table and possibly restore it to its default later.

generate/notepad1.gifFor a card file database the sort order name always matches the name of the field that was sorted. A sort order name of "DATE" means that the sort order is based on the DATE field.

Example #1

aOrder := Supplier->(OrderTable())

nSortOrder := aOrder[1]

cSortName := aOrder[2]

Example #1

* Set order to Product Description (TITLE)

Stock->(OrderTable("TITLE"))

____________________________

Related Topics:

Business Function List



CAPITAL VISUAL BUILDER