Pic$: Difference between revisions

From BR Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 4: Line 4:


====Comments and Examples====
====Comments and Examples====
  00010 PRINT "The currency symbol is ";PIC$
  00010 PRINT "The currency symbol is ";PIC$
  00020 PRINT USING 30: 12.34
  00020 PRINT USING 30: 12.34
Line 10: Line 11:
  00050 PRINT USING 30: 12.34
  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 output from running the above program, assuming the default for PIC$ was not changed since starting Business Rules, would be:
 
The currency symbol is $


The currency symbol is $<br>
   $12.34
   $12.34


The new currency symbol is #<br>
The new currency symbol is #
 
   #12.34
   #12.34


====Related Functions:====
====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.
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====
====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.
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:
For example, the command that starts Business Rules could be:
Line 34: Line 39:
  RUN MENU
  RUN MENU


:3.) On a multi-user system, changing the currency symbol at one workstation has no effect on other workstations.
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.
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)


<noinclude>
<noinclude>
[[Category:Internal Functions]]
[[Category:Internal Functions]]
</noinclude>
</noinclude>

Revision as of 09:47, 30 January 2012

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.