Export (0) Print
Expand All
Expand Minimize

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.

SET SEPARATOR TO [expC]

exprC

Specifies the character for the numeric place separator.

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.

NoteTip

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.

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."

Community Additions

ADD
Show:
© 2014 Microsoft