In this example, a function switches to a specific index tag before calling another function that creates a new record:

PROCEDURE NewStudent

   local cOrder 

   cOrder = order( ) 

   set order to STUDENT_ID 

   NewRec( ) 

   set order to ( cOrder ) 

This example function assumes that the Students table is the currently selected table, which might be ordered according to name, average test score, or some other index. This function saves the index order of the table in the variable cOrder. At the end of the function, that index is restored with the SET ORDER command using the parentheses as indirection operators.

The NewRec function is shown in the example for APPEND.