Translation types are used when adding translations so that you can add multiple, or a range of, translations without having to manually enter each individual translation. Once a translation is added to the table, it is essentially a simple one-to-one replacement. The DV2000/DV4 supports the following translation types.
Type
|
Description
|
Add value
|
Adds the modifier value to the source value to produce the result.
|
Subtract value
|
Subtracts the modifier value from the source value to produce the result.
|
Add prefix
|
Prepends the modifier to the front of the source value.
|
Add suffix
|
Appends the modifier to the end of the source value.
|
Replace with
|
Replaces the source value with the modifier value.
|
Apply mask
|
Applies the modifier (as a mask) to the source value to produce the result.
|
Remove leading zeros
|
Removes all leading zeros from the source value to produce the result.
|
Examples
The following table provides an example of each translation type in action, except Mask, which is discussed in the next section.
Type
|
Source
|
Modifier
|
Result
|
Add value
|
101
|
7000
|
7101
|
Subtract value
|
7101
|
7000
|
101
|
Add prefix
|
101
|
7
|
7101
|
Add suffix
|
101
|
0
|
1010
|
Replace with
|
101
|
8500
|
8500
|
Remove leading zeros
|
00101
|
Not used
|
101
|
For examples on using the Apply mask type, see below.
Apply Mask
Uses the modifier string as a mask for converting the Room Number string into the final result. The mask string is interpreted according to the following rules:
Character
|
Means
|
*
|
Copy the next digit to the result string no matter what it is.
|
^
|
Skip over and discard the next digit in the source string.
|
0-9
|
Any number in the mask string is copied as-is to the result string. The source string is not affected in this case.
|
The mask is interpreted left-to-right, one character at a time. Each instance of the * character copies a single digit from the room number (source) string to the mailbox (result) string, again working left-to-right. Likewise, each ^ character in the mask will discard the next character in the room number string, again proceeding from left-to-right order. Finally, any actual digit 0-9 that appears in the mask will be copied directly to the end of the mailbox string.
This translation type is the most complicated and, therefore, the most prone to being misconfigured. Consequently, it is recommended that you always use one of the other translation types unless you really need the flexibility that the Apply mask type offers.
Examples
The following table provides a selection of examples using the mask translation type.
Room #
|
Modifier (Mask)
|
Mailbox #
|
Comments
|
7110
|
***
|
711
|
The asterisk symbol copies the next digit from the source string to the result string. It only copies one digit.
So, in this example, the mask *** copies the first three digits only. The last digit is discarded.
|
7110
|
^***
|
110
|
The caret symbol skips over and discards the next digit in the source string. Only the one digit is discarded and nothing is copied to the result string.
So, in this example, the mask ^*** throws out the first digit, 7, and copies over the next three, 110.
|
101
|
8***
|
8101
|
A number in the mask is copied over as-is to the result string.
So, in this example, the 8 is copied to the result string and then the *** part of the mask copies the three digits from the source string to the result string.
|
201
|
70^**
|
7001
|
In this example, the '70' from the mask is copied to the result sting first, then the '1' from '201' is discarded, and finally the '01' is copied to the result.
|
Expanded Example
To better understand how the mask string and source string are processed together to create the mailbox number string, let's consider a more complex (if unlikely) example.
First, the translation in summary form:
Source
|
Modifier (Mask)
|
Mailbox Number
|
7101101
|
^^^8****
|
81101
|
Now, consider the steps used to arrive at the above result. In each step, the mask digit and the room number digit being processed are both in bold, red type. To make it even more clear, the digit in question is also shown enclosed in square brackets, like so: [^]
Step
|
Description
|
Mask
|
Source
|
Mailbox Number
|
1
|
Apply first ^ to first digit in the source. Since ^ means discard, the mailbox number is unchanged.
|
[^]^^8****
|
[7]101101
|
|
2
|
Apply second ^ to the second digit in the source.
|
^[^]^8****
|
7[1]01101
|
|
3
|
Apply third ^ to the third digit in the source.
|
^^[^]8****
|
71[0]1101
|
|
4
|
Copy the 8 directly to the end of the mailbox number. Since the mailbox number is currently empty, the 8 becomes the first digit.
No digits in the source are copied or discarded in this case, so the next step will address the fourth digit, not the fifth.
|
^^^[8]****
|
(ignored)
|
8
|
5
|
Apply the first * to the fourth digit of the source. Since * means copy, the digit 1 is copied to the end of the mailbox number.
|
^^^8[*]***
|
710[1]101
|
81
|
6
|
Apply the second * to the fifth digit of the source.
|
^^^8*[*]**
|
7101[1]01
|
811
|
7
|
Apply the third * to the sixth digit of the source.
|
^^^8**[*]*
|
71011[0]1
|
8110
|
8
|
Apply the last * to the last digit of the source.
We have reached the end of the mask, so the final mailbox number is 81101.
|
^^^8***[*]
|
710110[1]
|
81101
|
|