XPAC Reference Guide

Classified fields

Classified fields

Previous topic Next topic  

Classified fields

Previous topic Next topic  

Classified fields are used to allocate records into groups or classifications to assist with the reporting and manipulation of data. The classifications are given a name and these names are stored in the classified data field for each database record. Each classification is a string of text up to 50 characters in length.

Classified fields cannot be accumulated up the database structure, as an upper level record may be made up of many different classifications. Classified fields can be used in XCM and in database ranges to process records in different ways, according to which classification they belong to. Any number of classified fields may be set up in a database.

An example which makes use of a classified data field is the allocation of underground coal mining blocks as either development or longwall blocks. You could do this by setting up a classified data field called "Process". You would then attach two classifications to the data field, namely "Development" and "Longwall" and each record in the database would be assigned as one or the other via an XCM. Classifications can also be entered manually for each record, however for a large database this would be impractical.

Defining classifications

All of the classifications which are to be attached to a classified field have to be defined. They can be defined manually before you try to assign classifications to records. Alternatively, if you try to assign classifications to database records before they are defined, then you will be asked to define them each time a new classification is encountered.

Manually defining classifications

To define classifications manually, move to the data sheet and click the classified data field for any lowest level database record. If you then right-click and select Classifications, XPAC will display the following dialog. It shows the list of classifications currently defined for the chosen data field.

Manually Defining Classifications

To add classifications to the list (which will initially be empty), click New then type the name of the classification. To delete or rename a classification, select the required classification then click wither Delete or Rename as appropriate. Once you are satisfied with the list of classifications, click OK to accept them and return to the data sheet.

This window is also used as a selection list for classifications. Consequently, when you click OK, the classification which is currently highlighted will be assigned to the database record on which your cursor was located when you went in to edit the classifications.

If you try to enter a classification which has not yet been defined, XPAC will require you to define it.

Defining classifications in an XPAC Command Module (XCM)

Classifications can be assigned to records from within an XCM. You cannot simply write that a data field in your database is equal to a classification, rather you must use the SetClass Function. To assign a data field in your main database which has the code "Process", with a classification called "Longwall", you would put one of the following lines in your XCM.

Call SetClass(mProcess, "Longwall")

OR

SetClass mProcess, "Longwall"

When classifications are assigned via an XCM, if they do not already exist then you are not asked if you want to create them. They will automatically be created.