method AddIndex(Name: String, Fields: String[, Unique: Boolean, Descending: Boolean, CaseInsensitive: Boolean])
AddIndex method adds a new index to a Memory Table definition.
You can specify the index ordering by using +'s and -'s before each field to specify its sort order (+ is the default if nothing is specified). If the order is specified for the first field of the index only this ordering will apply to all parts of the index.
AddIndex method syntax has these named arguments:
Parameter |
Description |
|---|---|
Name |
Required. Name for the index. Must be a valid MaxBasic identifier. |
Fields |
Required. List of fields to include in the index, each field separated by a semi-colon (;). |
Unique |
Optional. Ensure that no set of fields exists more than once in the index. |
Descending |
Optional. Sort the index in descending order. |
Case Insensitive |
Optional. Ignore case when sorting alphabetic characters. |
For example:
tblTable.AddIndex("AreaCode", "-SalesArea;+CustCode", True)