CTRL() Function

BBj-Specific Information

For this topic's original documentation, see the CTRL() Function.

Parameters

Parameter

Description

function

If not specified, the default is set according to the type of object in question. The following types behave as though function=2 (Get value) was requested: radio buttons, check boxes, list boxes, list buttons, scroll bars, menu items, tool buttons, and splitters. All others behave as though function=1 (Get text) was requested.

CTRL() Function 2 – Get Value (BBj 3.02 and higher)

This CTRL() function returns a value, according to the following:

Resource

Item Returned

INPUTD and INPUTD spinner

A 4-byte signed binary integer representing the Julian date of the control. If the text in the control is blank or does not correspond to a valid date, this returns a value of -1 ($FFFFFFFF$).

Splitter control (BBj 23.00 and higher)

A 2-byte binary integer corresponding to BBjSplitter::getPosition().

INPUTT and INPUTT spinner (BBj 24.00 and higher)

An 8-byte business math string corresponding to BBjInputT::getValue():

DIM INPUTT$:"VALUE:B"

LET INPUTT$ = CTRL(sysgui,controlid,2)

PRINT INPUTT.VALUE

CTRL() Function 4 – Get Type

This CTRL() function returns the object type as two binary bytes. The first byte is the class of the object, and the second byte is the type of the object.

BBj reports the class of a CEDIT control as generic (first byte = 1) rather than customEdit (first byte = 2). The second byte of CTRL() 4 will still be 22 (custom edit control).

BBj supports additional values for the second byte as follows:

Second Byte Decimal Value

Type of Object

24

Line Chart

25

Bar Chart

26

Pie Chart

27

HtmlView control

28

MenuButton control

29

PrintPreview control

30

Generic Chart

31

Wrapped JComponent

32

WebComponent (BBj 24.00 and higher)

91

INPUTT control (BBj 24.00 and higher)

92

INPUTT Spinner control (BBj 24.00 and higher)

99

Splitter control (BBj 23.00 and higher)

99 Splitter control

108

Image control

109

Tree control

112

ProgressBar control

113

Navigator control

114

INPUTD control

117

Horizontal slider control

118

Vertical slider control

119

FileChooser

120

ColorChooser

121

FontChooser

122

DataboundGrid control

123

INPUTDSpinner control

124

INPUTESpinner control

125

INPUTNSpinner control

126

EditBoxSpinner control

127 HtmlEdit control

CTRL() Function 14 – Get Printer Setup

CTRL() Function 16 – Retrieve Foreground Color

In Windows, this function returns the current window TEXTCOLOR. In Visual PRO/5, it always returns the system default window text color. To retrieve that value in BBj, use:

SENDMSG(sysgui,-1,1,0,$19$)

CTRL() Function 17 – Get Child Window Context ID

This CTRL() function returns the context ID of a child window within the given context.

Function

Description

17

Returns the context of a child window as a binary string. Convert to a number as in the following:

context=dec(ctrl(sysgui,child_control_id,17,parent_context))

See Also

Functions - Alphabetical Listing