Quick reference information for Calculation Commands |
Calculation commands are great if you know the name of the field and you want to manipulate it.
However, sometimes you may need to add a new field from a pick list in order find the name of what you want. |
The third line of the sample screen C_HOME_PHONE has no formatting in the field calculation.
This instructs the printer to left justify the home phone of the patron starting in row 15 and column 1040. To justify the phone number place the field in brackets and prefix it with the letters 'jst'. Follow the field (inside the bracket) with a comma and a single quote to start the formatting instructions, enter the formatting instructions, and close with a single quote.
For example, jst(C_HOME_PHONE,'-8') formats the field calculation to allocate 8 spaces for the home phone number and to right justify when printing.
String | Description | Example |
jst () |
jst(string1,number1,string2,number2,string3,number3,...) Returns a string containing the specified string left or tight justified with sufficient spaces added to make a total length specified by number. The jst() function also includes concatenation. If number is negative the resulting string is right justified, if the number is positive the string is left justified; number must be in the range of 1 to 999. |
|
^n | (caret) Causes the data to be centered in the field n characters wide. |
|
-n | (minus) Causes the data to be right justified in a field n characters wide. |
|
$ | Places a $ sign in front of the data. |
|
Pc | Causes the part of the field not filled by the data to be filled by character c. |
|
X | Causes the data to be truncated if its length exceeds the field length. The default is not to truncate. |
|
U | Causes the data to be converted to upper case. |
|
L | Causes the data to be converted to lower case. |
|
C | Causes the data to be capitalized. |
|
Nnn | Causes the data to be treated as a fixed decimal number with nn decimal places. |
|
E | Applies to numbers only and displays a blank when the number is zero. |
|
, | Applies to numbers only and adds commas as number separators. |
|
String | Description | Example |
cap() |
Returns the capitalized representation of a string, that is, the first letter of each and every word in the string is capitalized. |
|
con(string1, string2, [,string3] ...) |
Returns a string concatenating or combining two or more string values.
Theatre Manager will build concatenations. Simply select more than one field from the available fields list when editing the field calculation. To format the concatenation simply treat the concatenation as one field calculation. |
First name, address, and postal code information together on the same line and places a slash between each item. Formatting is limited to the group of fields linked together.
Centers section, row, and seat number in a space 38 characters wide. A comma and row precede the row number and separate it from the actual number. A comma and seat precede the seat number and separate it from the actual number.
Prints 'Saturday, December 21 1998 Time: 8:00 PM'. The printing would be centered in a 50 character space. |
len() | Returns the length of the string, that is, number of characters. |
|
low() | Returns the lower case representation of a string. Any non-alphabetic characters in the strings are unaffected by low(). |
|
mid( string, position, length) | Returns a substring of a specified length, starting at a specified position, from a larger string. If position is less than 1 it is taken as 1, that is the first character; if it is greater than the length of the string, an empty string is returned. If length is greater than the maximum length of any substring of string starting at position, then the returned substring will be the remainder of string starting at position.. |
|
pos(substring, string) | Returns the position of a substring within a larger string. The substring must be contained within string in its entirety for the returned value to be non-zero. |
|
upp() | Returns the upper case representation of a string. Any non-alphabetic characters in the strings are unaffected by low(). |
|
tStringFields.$splitString( String1, width, segment) |
Returns the Nth segment from the string string where the string is broken into even word boundaries that are no no longer than width.
CR's LF's, Tabs are converted to spaces and double spaces are then removed from within the string. |
example: tStringFields.$splitString(P_PLAY_TITLE,1)
will take a long string like P_PLAY_TITLE and find entire words within the width of 40 characters and return only those. eg, for a title like:
|
tTicket.$getReceipt( Pixels) | Prints a Moneris EMV receipt on the ticket printer using the font and rotation indicates. The receipt starts printing at the row and column specified. Each successive line will be separated by the number of DPI in the parameter. | This function is best if it is the only thing in the calculation. If the payment was not taken through a Moneris EMV machine, you will want to print regular payment information instead. A sample payment receipt has been created for you that you can import which handles both EMV and internet credit card receipts in one ticket face. |
The date/time functions operate on a datestring to return date values or strings representing some part of a date/time. A datestring is a string recognizable as a date using a date format.
String | Description | Example |
dat(datestring| number [,dateformat]) |
Converts a datestring or number to a date value using a second optional argument, a dateformat string. The date formatting string can be composed of the following symbols:
|
|
dim(datestring,number) |
Increments a datestring by a number of months. Months containing different numbers of days are accounted for. Jan 31 96 increased by one month gives Feb 29 96, but beware, Feb 29 96 decreased by one month (using a negative number) returns Jan 29 96, not Jan 31 96. |
|
dtcy(datestring) |
Returns the year and century of a datestring as a string. |
|
dtd(datestring) | Returns the day part of a datestring unless it is part of a calculation when it is returns as a number. |
|
dtm(datestring) | Returns the month part of a datestring. |
|
dtw(datestring) | Returns the week part of a datestring. |
|
dty(datestring) | Returns the year part of a datestring. |
|
tim(timestring[,timeformat]) |
Converts a timestring to a time value using a second optional argument, a timeformat string. The time formattinG string can be composed of the following symbols:
|
|
The lookup functions provide a method for selecting items from a list of values.
String | Description | Example |
max(value1[,value2]...) |
Returns the maximum value from the list of values. The values should all be numbers when numeric comparison is used or all strings when string comparison is used. |
|
min(value1[,value2]...) | Returns the minimum value from the list of values. The values should all be numbers when numeric comparison is used or all strings when string comparison is used. |
|
pick(number,value0,value1,[value2]...) |
Selects an item from a list of string or numeric values. The number argument is rounded to an integer and used to select the item. value0 is returned if the result is 0, value1 if the result is 1, value2 if the result is 2, and so on. If the number is less than zero or greater than the number of values in the list, then an empty value is returned. The list of values can be a mixture of string and numeric values. |
|
String | Description | Example |
abs(number) |
Returns the magnitude of a real number ignoring its positive or negative sign. |
|
int(number) |
Returns the integer part of a number; it does not round to the nearest integer. |
|
mod(number1,number2) | Returns the remainder of a number division, that is, when number1 is divided by number1 to produce a remainder; it is a true modulus function. |
|
rnd(number,dp) |
Rounds a number to a specified number of decimal places by dp . |
|
Entering a label, or string of characters that will be the same on every ticket, is accomplished by placing the label in single quotes.