GetFormat method (DataWindows)
Description
Obtains the display format assigned to a column in a DataWindow
control or DataStore object.

component
A separate method, GetFormatByColNum, is
provided as an alternative syntax for the Web DataWindow server
component, which cannot use overloaded methods.
Controls
DataWindow type |
Method applies to |
---|---|
PowerBuilder |
DataWindow control, DataWindowChild object, DataStore |
Web |
Server component |
Web ActiveX |
DataWindow control, DataWindowChild object |
Syntax
[PowerBuilder]
1 |
string <span>dwcontrol</span>.<span>GetFormat</span> ( string <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetFormat</span> ( integer <span>column</span> ) |
[Web DataWindow server component]
1 |
string <span>dwcontrol</span>.<span>GetFormat</span> ( string <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetFormatByColNum</span> ( short <span>column</span> ) |
[Web ActiveX]
1 |
string <span>dwcontrol</span>.<span>GetFormat</span> ( string <span>column</span> )<br>string <span>dwcontrol</span>.<span>GetFormat</span> ( number <span>column</span> ) |
Argument |
Description |
---|---|
dwcontrol |
A reference to a DataWindow control, |
column |
The column for which you want the display |
Return Values
Returns the display format specification for column in dwcontrol.
If an error occurs, GetFormat returns the empty
string (” “).
If any argument value is null, in PowerBuilder and JavaScript
the method returns null.
Usage
If you want to change the display format of a column temporarily,
you can use GetFormat to save the current format.
Examples
These statements save the format of column salary
of dw_employee before changing it to a new format:
1 |
string OldFormat, NewFormat = "$##,###.00" |
1 |
OldFormat = dw_employee.<span>GetFormat</span>("salary") |
1 |
dw_employee.SetFormat("salary", NewFormat) |