Condividi tramite


SET SEPARATOR Command

Specifies the character that separates each group of three digits to the left of the decimal point when displaying a formatted numeric or currency value.

Syntax

SET SEPARATOR TO [expC]

Parameters

  • exprC
    Specifies the character for the numeric place separator.

Remarks

Use SET SEPARATOR to change the numeric place separator from the default, for example a comma (,). Issue SET SEPARATOR without its argument to reset the value to its default.

Tip

If you use the command SET SYSFORMATS ON, the character for the numeric place separator is set by the Windows Regional Options Control Panel. Using this command will re-set the character to your regional default until the next time you issue a SET SEPARATOR exprC command.

SET SEPARATOR is scoped to the current data session.

Example

SET SEPARATOR TO && reset to default
_Screen.AddObject("t","textbox")
_Screen.t.InputMask = "9,999.99"
_screen.t.Value = 1000
_Screen.t.Visible = .T. 
WAIT WINDOW "Note the value in the textbox: looks like 1,000.00"

* now change the separator:
SET SEPARATOR TO "#"
WAIT WINDOW "Note the value in the textbox: looks like 1#000.00"

* now indicate that you want regional defaults:
SET SYSFORMATS ON
WAIT WINDOW ;
   "Note the value in the textbox: looks like 1,000.00 again" ;
    + CHR(13) + ;
   "because SET SYSFORMATS ON was issued."

? SET("SEPARATOR") 
WAIT WINDOW ;
   "Note the value of SET('SEPARATOR') now also reflects the default." 

SET SEPARATOR TO "#"
WAIT WINDOW ;
   "The textbox changes again." ;
    + CHR(13) + ;
   "Although SET SYSFORMATS is still ON, SET SEPARATOR is more recent."

See Also

Concepts

Format Expressions for Field Controls

Reference

SET SYSFORMATS Command

SET POINT Command

SET DECIMALS Command

SET DATASESSION Command

SET Command Overview

InputMask Property

TRANSFORM( ) Function

Other Resources

Commands (Visual FoxPro)

Language Reference (Visual FoxPro)