Format

Description

The display format for a column.

You can use the GetFormat and SetFormat methods instead of Describe and Modify to get and change a column’s display format. The advantage to using Modify is the ability to specify an expression.

Applies to

Column and Computed Field controls

Syntax

PowerBuilder dot notation:

dw_control.Object.controlname.Format

Describe and Modify argument:

"controlname.Format { = ' value ' }"

Parameter

Description

controlname

The name of the column or computed field for which you want to get or set the display format.

value

(exp) A string specifying the display format. See the Users Guide for information on constructing display formats. Value can be a quoted DataWindow expression.

Usage


In the painter

Select the control and set the value in the Properties view, Format tab.

If you want to add text to a numeric display format and use a color attribute, you must include the escape character (\) before each literal in the mask. For example:

[red]\D\e\p\t\: ###

Examples

Example 1

setting = dw1.Object.phone.Format

dw1.Object."phone.Format = "[red](@@@)@@@-@@@@;'None'"

Example 2

setting = dw1.Describe("phone.Format")

dw1.Modify( &

"phone.Format='[red](@@@)@@@-@@@@;~~~'None~~~''")

See also