XPAC Reference Guide

Data field levels

Data field levels

Previous topic Next topic  

Data field levels

Previous topic Next topic  

Data field codes and levels are used to uniquely identify a data field, enabling reference by XCM scripts for data manipulation as well as reference from other parts of XPAC, such as schedule setup.

Data field codes make use of data field level numbers to apply a hierarchy to the data fields. This hierarchy is used:

to provide a means of collapsing or hiding data fields when they are temporarily not required; and
to simplify the code names.

Expanding and collapsing data fields

The data field level number can be used as a means of collapsing or hiding data fields in the data sheet. The default data field level number is 0. If you enter a level number of 1, that data field becomes a child of the previous level 0 data field. Similarly if you give a data field a level number of 2, it becomes a child of the previous level 1 data field. In this way a hierarchy can established amongst the data fields.

When the data fields are in expanded view, all of the children data fields will be displayed. In this view, a minus symbol is displayed to the left of the parent data field codes. Double-click the Collapse glyph to collapse the data fields and hide the children.

Data fields which have no children have a dot displayed to the left of their data field code.

In collapsed view a plus sign is displayed to the left of the parent data field code, to indicate that child data fields are present but not displayed. Double-click the Expand glyph to expand the data fields and display the children.

All child data fields of a parent may be expanded using the * key on the number pad of your keyboard.

Note that XPAC automatically indents the data field name of a child data field, with each successive level becoming further indented.

Referencing data fields in XCM using codes

Data fields may be referenced in XCM using the full code name. The reference begins with a capital M for the main database, a capital C for the calendar database and a capital R for the results database. The capital letter is followed by round brackets and inside the brackets is the full code name as follows.

M(main database data field full code name)

C(calendar database data field full code name)

R(results database data field full code name)

Data fields may also be referenced using the data field number. The disadvantage of using numbers is that when data fields are moved and inserted, the data field numbers change. It is recommended that you use data field codes in preference to data field numbers.

Full code name

The full code name includes the code names for higher level data fields. It starts with the previous highest level code (in most cases, level zero) and progresses through the levels to the code name for the required level. Each level code is separated by an underscore character.

The maximum length for the full code name is 39 characters. This includes all level codes (each of which must be 12 characters or less) and the underscore characters.

Note that the upper level data fields tend to be headings, though they do not have to be.

For example, consider the following list of main database data fields.

Data Field - Full Code Name

Data field number 36, called Insitu Coal Volume, has been assigned as level 2. It's full code name is therefore made up of the previous level 0 and level 1 codes as well as its own code, separated by underscores and prefixed by a lower case m as it is in the main database. The full code name for this data field would be as follows:
mls_Cl_Vol

In XCM, the data field would be referenced as:

M(mls_Cl_Vol)

Similarly, data field number 45, called Insitu Coal Product Type, would have a full code name of:

mls_Cl_Prd_Typ

and be referenced in XCM as:

M(mls_Cl_Prd_Typ)

Information

You can display full codes by selecting Edit > Show Full Row Codes from the application menu, or by pressing Ctrl+R.

Missing levels

It is possible to have a level missing for some data fields. This is illustrated in the following example:

Data Field - Missing Levels

Data field number 2, called Block Area, has been assigned as level 2, however there is no level 1 data field above it (and after the previous level 0 data field). This is quite acceptable, however the full code name for the data field must be written as if the level 1 data field exists but has no code. The full code name for the Block Area would therefore be:

mGeo_ _Area

Advanced uses of codes in XCM

It is relevant to note that the full code names for the data fields are like variables in XCM, which have been assigned the value of their current data field number. In the example above, data field number 5 can be written as either M(5) or M(mGeo_CoalVol). This means that the variable called mGeo_CoalVo (the full code name) has a value of 5 (the data field number). This is useful in XCM where you may want to use a Loop to assign values to a regular pattern of data fields.