Some controls let you specify a picture token that provides a special format for display or printing of variables
There is a great variety and diversity of picture token syntax that depends on the type of data you format: strings, numbers, currency, scientific, dates, times, etc.
The Edit Picture dialog lets you quickly and easily build an appropriate picture token without memorizing picture token syntax. Invoke this easy to use dialog by pressing the ellipsis (…) button beside the Picture prompt in the properties dialog.
Example | An example of the display format currently specified in the dialog. What you see is what you get. |
Pool | Select a predefined picture from the drop list. |
Save As | Press this button to save the displayed picture to the Pool, and name the saved picture. The saved pictures are available in the Pool drop-list. You can save your most frequently used pictures, and then quickly reuse them from the Pool. Note: The Picture Editor stores the pictures in the ..\BIN\ClaPict.ini file. |
Delete | Press this button to delete the displayed Pool picture currently displayed in the Pool field. |
Picture | The picture token currently specified. This picture token produces the example shown. |
Picture Type | Select the type of data to format from this drop-down list. Choose from: |
String | |
Numeric and Currency | |
Scientific Notation | |
Date | |
Time | |
Pattern | |
Key-in Template |
String
String Pictures specify a length with no other formatting.
Length
Specify the length of the string. This length also determines the width of the control if the width is not otherwise specified by the control's AT attribute.
Numeric and Currency
Numeric and Currency picture tokens specify a length, plus conventional formatting to convey positive and negative values, various currencies, etc.
Size
The total number of significant digits, plus any formatting characters. For example, $22.25- is 4 significant digits + 3 formatting characters for a size of 7.
Decimal Digits
The number of digits to the right of the decimal.
Currency
Choose from None, Leading, and Trailing. None shows no currency symbol. Leading puts the currency symbol to the left of the number and Trailing puts the symbol right of the number.
Symbol
The currency symbol to display: either a dollar sign ($) or a string constant.
Negative Sign
Specify how negative values are formatted.
Bracket
Negatives surrounded by parentheses.
Leading
Negatives get a leading minus sign.
Trailing
Negatives get a trailing minus sign.
None
No sign display.
Decimal Separator
Specify the character inserted between the integer and fractional portion of the value.
Period
Period is the separator.
Comma
Comma is the separator.
None
Displays no separator.
Grouping
Specify the character inserted at every third digit to aid readability.
Comma
Comma is the separator.
Period
Period is the separator.
Space
Space is the separator.
Hyphen
Hyphen is the separator.
Leading Character
Specify the character to represent leading zeroes.
Clip
Remove leading zeroes so that any leading format characters abut the left most digit.
Zero
Leading zeroes display as zeroes (0).
Space
Leading zeroes display as spaces ( ).
Asterisk
Leading zeroes display as asterisks (*).
Blank When Zero
Check this box to display nothing when the value is zero.
Scientific
Scientific Notation picture tokens let you display very large or very small numbers with a decimal format raised by a power of ten. The display takes the form -9.99e+999.
Number of Characters | The total number of characters, including the 7 format characters. For example, -1.96e+007 requires 10 characters. |
Leading Digits | The number of digits to the left of the decimal point (typically 1). |
Decimal Separator | Specify the character inserted at every third digit to aid readability. |
Point | Period is the separator. |
Comma | Comma is the separator. |
Space | Space is the separator. |
Separator | Specify the character inserted between the integer and fractional portion of the value. |
Point | Period is the separator. |
Comma | Comma is the separator. |
Blank When Zero | Check this box to display nothing when the value is zero. |
Date
Date picture tokens let you display dates in a number of different formats. Choose the format you want from the Format drop-down list.
Better still, date picture tokens in entry fields automatically invoke Clarion's run-time date parsing functions, so you can enter '21' and Clarion expands it to the 21st day of the current month and year. Or you can enter 'DEC' and Clarion expands it to the 1st day of December of the current year. The date is then formatted according to the picture token.
The MASK attribute (Entry Patterns check box) on a window preempts the date parsing functions.
Format
Choose the format you want from the drop-down list. What you see is what you get except for the Windows Short and Windows Long formats. Additionally, the separator character and leading zeroes may be specified independent of the chosen format.
Windows Short
Uses the short date format specified in the Windows control panel or the Windows 95 Regional Settings control panel.
Windows Long
Uses the long date format specified in the Windows control panel or the Windows 95 Regional Settings control panel.
Separator
Choose from Standard (/), Period (.), Dash (-), Space ( ), and Comma (,).
Leading Characters
Specify the character to represent leading zeroes.
Zero
Leading zeroes display as zeroes (0).
Blank
Remove leading zeroes.
Asterisk
Leading zeroes display as asterisks (*).
Two digit date range
Change the default century interpretation for dates input with a two digit year. By default, Clarion assumes any date input with a two digit year (i.e. the century value is omitted) falls between today-80 years and today+19 years.
For example, if today is June 1, 1996 and the date input is 9/2/59, Clarion assumes the 59 means 1959 since 1959 falls between today-80 years (June 1, 1916) and today+19 years (June 1, 2015). To force a different interpretation, set the Two Digit Date Range to 30. Now Clarion assumes the 59 means 2059 since 2059 falls between today-30 years (June 1, 1966) and today+69 years (June 1, 2065).
Blank When Zero
Check this box to display nothing when the value is zero.
Time
Time picture tokens let you display times in a number of formats. Choose the format you want from the Format drop-down list.
Format
Choose the format you want from the drop-down list. What you see is what you get except for the Windows Short and Windows Long formats. Additionally, the separator character and leading zeroes may be specified independent of the chosen format.
Windows Short
Uses the time format specified in the Windows control panel.
Windows Long
Uses the time format specified in the Windows control panel.
Separator
Choose from Standard (:), Period (.), Dash (-), Space ( ), and Comma (,).
Leading Character
Specify the character to represent leading zeroes.
Zero
Leading zeroes display as zeroes (0).
Blank
Remove leading zeroes.
Blank When Zero
Check this box to display nothing when the value is zero.
Pattern
Pattern pictures let you build custom display formats for various numbers: phone numbers, social security numbers, room numbers, dates, times, measurements, etc.
Picture
Type the picture token between the 'P's according to the Legend below. Your picture token can include any displayable characters, including all the standard keyboard characters.
At runtime, the constants in the picture token display just as they appear in the token. The left angle (<;) and the pound sign (#) resolve into the individual digits from the display variable.
Legend
<; | integer, blank if zero |
# | Integer |
constant | (any displayable char except <; and #) |
Blank When Zero
Check this box to display nothing when the value is zero.
To use a lowercase p in your picture, use an uppercase P at the start and end of your picture token. To use an uppercase P in your picture, use a lowercase p at the start and end of your picture token.
Key-in Template
Key-in Pictures let you build custom edit formats for runtime fields containing mixed alphanumeric characters. Although Key-in tokens affect output as well as input, their primary purpose is to provide custom field editing and validation on input.
Picture Type the picture token between the 'K's according to the Legend below. Your picture token can include any characters (displayable or not), including all the standard keyboard characters.
Legend
<; | accept an integer, blank if zero | ||
# | accept an integer | ||
? | accept any character (even non-display) | ||
accept an upper case character | |||
_ | accept a lower case character | ||
input may stop here | |||
constant | (any displayable char except <;#? | _ | or \) |
\ | display next char (lets you display <;#? | _ | or \) |
Only Alphabetic Characters
Check this box to accept only alphabetic characters.
Blank When Zero
Check this box to display nothing when the value is zero.
To use a lowercase k in your picture, use an uppercase K at the start and end of your picture token. To use an uppercase K in your picture, use a lowercase k at the start and end of your picture token.