Every record in an XPAC database has a unique identification number that is allocated when the record is created. This is called the record number. When a new database is created, there is only one record in the database (called Deposit in the Main database and Top in the other databases) which is allocated a record number of 1. Thereafter, record numbers are created sequentially. Because XPAC creates the upper and lower level records required to represent a reserve unit at the same time, lower level record numbers are seldom contiguous across different sub-trees.
When records are deleted from the database, they leave holes in the record numbering sequence which may be filled if a new record is created. There is a facility which will remove these holes, making your database smaller and more efficient. To access this facility you must first close your project, but not XPAC. This is done by selecting File from the application menu and then Close from the pull down menu. Next you should select Tools from the application menu and Partial Compact Project from the pull down menu. You will then be asked for the name of the project that you wish to compact.
Using record numbers to uniquely identify each record is a very efficient method, however they cannot be used to represent the hierarchical relationships in large reserve projects. Furthermore, they do not indicate which reserve units they are modelling and are meaningless to planning staff.
Record numbers can be valuable when writing XCM scripts, as they provide a convenient means of referencing and operating on records. But as they are modified every time a project is compacted, absolute record numbers should never be used within an XCM Script. The only exception to this rule is the use of record number 1 to refer to the Deposit or Top record in a database.
The only safe method of using record numbers in XCM is by assigning them directly to a variable, which is used later in the same script. In most situations, we would recommend using record names to identify specific records, rather than record numbers. These not only remain fixed but they also identify the record they are modelling and are meaningful to planning staff.