Format
Takes five parameters, FieldBase, FieldList, Mask, bBlanks2Zero, IfLenFld
Usage:
FieldBase, FieldList, Mask, bBlanks2Zero, IfLenFld
[WorkWith], FieldList, Mask, bBlanks2Zero, IfLenFld
[WorkWith], FieldList, Mask, bBlanks2Zero, [""]
[WorkWith], FieldList, Mask, [""], [""]
When inside a WorkIf Block:
FieldBase, FieldList, Mask, bBlanks2Zero, [WorkIf]
[WorkWith], FieldList, Mask, bBlanks2Zero, [WorkIf]
[WorkWith], FieldList, Mask, [""], [WorkIf]
Description:
Format one or more numeric fields with the same mask. The mask may be a built in format, or a custom mask.
FieldList should be a space separated list of Fields to have Mask applied to.
bBlanks2Zero if false (blank) will leave all blank values as blank. If bBlanks2Zero is true (not blank) then any blank values will be set to zero before applying the Mask.
Mask Options:
- Date
- Formats as YYYY-MM-DD; will add the dashes if they are missing
- Time
- Formats as hh:mm:ss; will convert am/pm times to 24 hours
- AmPm
- Formats as 12 hour time, with optional leading date
- DateAmPm
- DateTime
- Enforces valid [DateTime] format, with error reporting
- If the Work Query field Error does not already exist when this option is run, it will be created. For any errors that occur per record, the error message for each record will be placed in the Error field.
- FileSize
- Formats as KB (Kilobytes)
- $
- A custom Mask may be made up of the following:
- 0 indicates a digit position that will always be shown, even if that value is zero
- # indicates a digit position that will only be shown if it there are enough digits to fill it
- #, at the start of a mask indicates that a , should be inserted every three digits on the left side of the decimal point
- , may also be used in between specified 0s and #s
- . indicates the decimal point position
- % at the end of a mask will multiply the number by 100 and add the % sign
Examples:
WorkWith "Finance.Transaction"
Format "Date", "Date"
Format "Price", "$"
Format "Qty", "#,0.0", "y"
End WorkWith