Specifies a display format for a column in a DataWindow control or DataStore.
integer dwcontrol.SetFormat ( string column, string format )
integer dwcontrol.SetFormat ( integer column, string format )
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, DataStore, or child DataWindow. |
column |
The column for which you are specifying the display format. Column can be a column number or a column name. |
format |
A string whose value is the display format for the DataWindow column. |
Returns 1 if it succeeds and -1 if an error occurs. The return value is usually not used. If any argument’s value is NULL, the method returns NULL.
For information on valid display formats for different datatypes, see the User’s Guide.
If you are specifying the display format for a number, the format must use U.S. notation. For example, comma (,) represents the thousands delimiter and period (.) represents the decimal place. During execution, the locally correct symbols will be displayed.
An EditMask edit style supersedes any display format applied to the column. When the column has an EditMask edit style, calling SetFormat has no effect.
These statements define the display format for column 15 of dw_employee to the contents of format1:
string format1
format1 = "$#,##0.00"
dw_employee.SetFormat(15, format1)
Copyright © 2004. Sybase Inc. All rights reserved. |
![]() |