Xbasic

INVERT Function

Syntax

A INVERT(A value)

Arguments

value

The name of a field in a table. Any type

Description

Used in index expressions to create an order from highest to lowest.

Discussion

INVERT() returns the complement of the value in the field specified by Field_Name. INVERT() is used in index expressions to create an order from highest to lowest, rather than the usual lowest to highest. INVERT() is needed only in multi-field indexes that involve mixed-level ordering.

The following index expression orders a table in ascending order by department, and within department in descending order by salary:

DEPARTMENT + str(invert(SALARY), 10, 2)
EMPLOYEE

NAME

DEPARTMENT AND SALARY

Deb

Marketing: 30000

Jim

Marketing: 27000

Robert

Marketing: 15000

Peter

Marketing: 10000

David

R&D: 34000

Paul

R&D: 18000

Elizabeth

R&D: 13500

Katie

R&D: 12000

See Also