Pic$

From BR Wiki
Revision as of 10:45, 12 January 2012 by Mikhail.zheleznov (talk | contribs) (edit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Pic$(A$)

The Pic$ internal function by itself returns the current currency symbol. Used with A$, it defines a new currency symbol to be A$.

Comments and Examples

00010 PRINT "The currency symbol is ";PIC$
00020 PRINT USING 30: 12.34
00030 FORM PIC($$$$.##)
00040 PRINT "The new currency symbol is ";PIC$("#")
00050 PRINT USING 30: 12.34

The output from running the above program (assuming the default for PIC$ was not changed since starting Business Rules ) would be:

The currency symbol is $

  $12.34

The new currency symbol is #

  #12.34

Related Functions:

For other features especially useful in markets outside the United States, see the INVP parameter of the OPTION statement and the optional format string in the DATE$ and DATE functions.

Technical Considerations

1.) After using PIC$(A$) to change the currency symbol, it will stay changed until you exit Business Rules , or until another PIC$(A$) function is executed to change it again.
2.) Some European customers may want to include this function in a procedure executed when starting Business Rules.

For example, the command that starts Business Rules could be:

BR "proc start"

and the procedure file START could include:

PIC$("#")
RUN MENU
3.) On a multi-user system, changing the currency symbol at one workstation has no effect on other workstations.
4.) The string argument A$ must be exactly one character long when the syntax PIC$(A$) is used to change the currency symbol.
5.) PIC((ZZZ,ZZZ.##)) now supports parentheses as digit identifiers (left side of the number only) and insertion characters, with the rule that parentheses will be output only if the number is negative. The left parenthesis that is closest to the number but not replaced with a digit will be output when the number is negative.
PRINT USING "FORM C 4,PIC((((ZZ,ZZZ.##))":"XXXx",-200

output:

XXXx   (  200.00)
PRINT USING "FORM C 4,PIC((((ZZ,ZZZ.##))":"XXXx",-200000

output:

XXXx (200,000.00)