Difference between revisions of "INDEXORDER()"

From Lianjapedia
Jump to: navigation, search
 
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
Function to return the currently selected master index number
+
Function to return the name of the currently selected master index
  
 
==Syntax==
 
==Syntax==
Line 9: Line 9:
  
 
==Description==
 
==Description==
The INDEXORDER() function returns the currently selected master index number as specified with the SET ORDER TO command.  If no index files are selected, it returns -1. If index file are open, and SET ORDER has been set to 0, the INDEXORDER() function returns 0.  If the optional <workarea | alias> is specified, then the function will operate in that <workarea | alias>.
+
The INDEXORDER() function returns the name of the currently selected master index: single index file basename or tag tagname.  If no master index is active, it returns an empty string.
When used in conjunction with the NDX() or INDEXKEY() functions, the INDEXORDER() function will return the index file name or index key of the master index.  The INDEXORDER() function is synonymous with the ORDER() function.
+
 
 +
If the workarea number or alias name <workarea | alias> is specified, then the function will operate in the required location.
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
use patrons index name, event
+
open database southwind
? indexorder()
+
use customers
        1
+
set order tag companyname_search
set order to 2
+
 
? indexorder()
 
? indexorder()
        2
+
companyname_search
 
</code>
 
</code>
  

Latest revision as of 08:28, 30 May 2013

Purpose

Function to return the name of the currently selected master index

Syntax

INDEXORDER([<workarea | alias>])

See Also

CLOSE INDEX, CREATE VIEW, IFILECOUNT(), INDEX, INDEXEXT(), INDEXKEY(), LOOKUP(), NDX(), ORDER(), REINDEX, RLOOKUP(), SEEK, SET INDEX, SET ORDER, SYS(), USE

Description

The INDEXORDER() function returns the name of the currently selected master index: single index file basename or tag tagname. If no master index is active, it returns an empty string.

If the workarea number or alias name <workarea | alias> is specified, then the function will operate in the required location.

Example

open database southwind
use customers
set order tag companyname_search
? indexorder()
companyname_search