The File Name of Code Order field shows the name of the order definition file that is placed in the shared/codeorder subdirectory located in the DBMaker installation directory. The order definition file is a text file that affects sorting results in DBMaker. It is used for sorting within indexes and for comparison operators in SQL WHERE statements. Any text editor can be used to create the order definition file.
The order definition file arranges the sequence of valid characters. The recommended naming convention is codename_ordertype.ord, where codename is the name of the language code and ordertype is the type of ordering, e.g., big5_stroke.ord.
Example
A simple order definition file:
Comment: write relevant information here.
[BEGIN] // begin to arrange the character sequence
c // ASCII 0x63
0x62 // Character 'b'
a // ASCII 0x61
[SINGLE] // Single-Byte Character Default Order
[DOUBLE] // Double-Byte Character Default Order
0xA440 // a Chinese character
0xA441 // a Chinese character
0xA442 // a Chinese character
All lines before the keyword "[BEGIN]" are considered comments. All of the words that appear after "//" or "/*" are also comments. After the "[BEGIN]" keyword, each line represents one character. The character definition should occupy the first position of the line and be followed by at least one space or a new line character "?#148;. Characters in the order definition file are listed from lowest to the greatest value. In the example just above, character "c" is less than "b" and "b" is less than "a".
If a text editor cannot edit some characters, they can be represented with a hexadecimal value. The character "a" can be represented by an "a" or the corresponding code value (0x61).
The creator of the sort order may only be interested in some characters and let others be sorted by default, i.e. binary. "[SINGLE]" and "[DOUBLE]" keywords can be used to represent the single character set and double character set, which are not specified in the definition file. If the keyword "[SINGLE]" is not added to the order definition file, single-byte characters that are not specified will be before all other characters in the definition file. If the keyword "[DOUBLE]" is not added to the order definition file, double-byte characters that are not specified will be after all other characters in the definition file.
DBMaker uses default settings if errors are found in the definition file. For example, if "[BEGIN]" is lost, DBMaker will use the default sorting for all characters. If the same character appears more than once, the first instance is processed and all others are ignored. After creating a new database, carefully check if the behavior of the sort order is correct. The default sorting sequence is according to the binary sequence of the language set being used.
In a distributed database environment, all databases should use the same sort order definition file. If copying or moving the entire database to another machine, remember to also copy the sort order definition file.
The order definition file is only used upon creation of
the database. Changing this field for an existing database has no effect.
Users can enter a new path for the order definition file by typing a new
path into the text field, or by clicking The
Browse Button (
) next to the text field. This setting
corresponds to the DB_Order keyword in the dmconfig.ini
file.