Equinox Online Help - Language Reference - A to Z

Home

ModifyIndex

Applies to
SyntaxModifyIndex IndexItem, [NewNameExpression, IFlagsExpression, Item1, Start1Expression, LenExpression1, FFlagsExpression1, Item2, Start2Expression, LenExpression2, FFlagsExpression2, Item3, Start3Expression, LenExpression3, FFlagsExpression3, Item4, Start4Expression, LenExpression4, FFlagsExpression4]
Action[Statement] Modifies an existing query index.
ScopeUsable anywhere.
Notes

This statement allows you to modify a query index definition dynamically from within the method language. The target query index is specified by the IndexItem parameter whilst the optional newname parameter contains the new name if you are renaming the index. The index type is set using the IFlagsExpression parameter:

  • 1 child, else global
  • 2 shared, else private
  • 4 unique, else standard
  • 8 unique if non blank
  • 16 only index non blank
  • 32 Alter the query index for the current user only, if possible

A combination of flags may be made by adding together the values. If the value 32 is supplied, and the following conditions are satisfied, Equinox alters the definition of the index for the current user only:

  • The index is not shared, and is not changed to be shared.
  • The index name is not changed.
  • The current user does not have multiple logins enabled.

In this case, the index definition becomes different from the base definition. If you include the value 32 and one of these conditions is not satisfied, the system workarea SysError is set to a non-zero value and no changes are made. If you wish to return to the base definition, delete the current index instance in Index Management, or use ModifyIndex and do not include the value 32.

Any field information specified overrides the current value. Item is the source field. StartExpression and LenExpression optionally specify a part of a field to index. The FFlagsExpression parameter can have the following values and can be added together:

  • 1 Ignore case, else don't
  • 2 Descending order, else ascending
  • 4 Delete index element

Leave out any parameters that you don't wish to change (you must still include the commas, even if you leave out items). The system workarea SysError is set to a non-zero value if an error occurs, otherwise zero.

All entries in the query index are removed for all users affected, and the index must be repopulated in the normal way, using MarkIndex and so on.

CategoryIndexes
See Also BlankIndex, CopyIndex, CurrentIndex, GroupSetIndex, IndexFromName, IndexLastUsed, IsDuplicate, KeyValues, MakeKey, MarkIndex, NameFromIndex, SetExecuteIndex, SetIndex, UnmarkIndex, UpdateIndex
Example

This first example renames an index.

ModifyIndex iCust, "iCustomer"

The next example modifies the index flags to being a unique child.

ModifyIndex iCustomer, , 1 + 4

The last example modifies the first field of an index to be in Descending order.

ModifyIndex iCustomer, , , , , , 2