Power COBOLReference
Power COBOLReference
The contents of this manual may be revised without prior notice. No part of this document may
be reproduced or transmitted in any form or by any means, electronic or mechanical, for any
purpose, without the express written permission of Fujitsu Limited.
Audience
This manual is directed at COBOL programmers who are using PowerCOBOL to
develop GUI applications.
Supported Environments
PowerCOBOL supports the following environments:
• Microsoft Windows 2000
• Microsoft Windows XP
• Microsoft Windows 2003 Server
• Microsoft Windows Vista
PowerCOBOL Reference 3
How this Manual is Organized
This manual consists of the following chapters and appendices:
Chapter Contents
Chapter 1. Introduction Describes PowerCOBOL and the PowerCOBOL
Reference. Information on upgrading from earlier
versions of PowerCOBOL.
Chapter 2. Objects Defines PowerCOBOL objects, and provides descriptions
of all the PowerCOBOL objects.
Chapter 3. Controls Defines PowerCOBOL controls, and provides descriptions
of all the PowerCOBOL controls.
4 PowerCOBOL Reference
Conventions Used in this Manual
This manual uses the following typographic conventions.
Example of Convention Description
Setup Characters you enter appear in bold.
Program-name Underlined text indicates a place holder
for information you supply.
ENTER Small capital letters are used for the
name of keys and key sequences such as
ENTER and CTRL+R. A plus sign (+)
indicates a combination of keys.
… Ellipses indicate the item immediately
preceding can be specified repeatedly.
Edit, Literal Names of pulldown menus and options
appear with the initial letter capitalized.
[def] Indicates that the enclosed item may be
omitted.
{ABC|DEF} Indicates that one of the enclosed items
delimited by | is to be selected.
CHECK Commands, statements, clauses, and
WITH PASCAL LINKAGE options you enter or select appear in
uppercase. Program section names, and
ALL some proper names also appear in
PARAGRAPH-ID uppercase. Defaults are underlined.
COBOL
ALL
PROCEDURE DIVISION
This font is used for examples of
ADD 1 TO POW-FONTSIZE OF LABEL1. program code.
IF POW-FONTSIZE OF LABEL1 > 70 THEN
MOVE 1 TOW POW-FONTSIZE OF LABEL1.
END-IF.
The sheet acts as an application creation form. Italics are occasionally used for
emphasis.
“NetCOBOL User's Guide” References to other publications or
sections within publications are in
quotation marks.
Related Manuals
PowerCOBOL Getting Started
PowerCOBOL User's Guide
Trademarks
Microsoft, Windows, and Windows NT, ActiveX and MDAC are trademarks or
registered trademarks of Microsoft Corporation.
Fujitsu is a registered trademark of Fujitsu Ltd.
PowerCOBOL Reference 5
Contents
ADODataSource Control..............................................................................44
DBAccess Control.......................................................................................51
6 PowerCOBOL Reference
DDE (Dynamic Data Exchange) Control .......................................................54
FileList Control...........................................................................................58
Graph Control............................................................................................61
Label Control.............................................................................................64
ListView Control.........................................................................................66
Print Control..............................................................................................70
ScrollBar Control........................................................................................72
TextBox Control.........................................................................................80
PowerCOBOL Reference 7
Toolbar Control .........................................................................................83
8 PowerCOBOL Reference
Caption Property .............................................................................................108
CaptionBackGray Property................................................................................109
CellLines Property............................................................................................109
Charset Property .............................................................................................110
Check Property................................................................................................110
Child Property (Array) ......................................................................................111
CHVisible Property ...........................................................................................111
ClassMajorVersion Property ..............................................................................112
ClassMinorVersion Property ..............................................................................112
ClassProgID Property .......................................................................................112
ClickColumn Property.......................................................................................113
ClickRow Property ...........................................................................................113
ClientHeight Property.......................................................................................113
ClientLeft Property...........................................................................................114
ClientTop Property...........................................................................................114
ClientWidth Property........................................................................................114
ColorMap Property...........................................................................................115
Column Property .............................................................................................115
ColumnCaption Property ..................................................................................116
ColumnCount Property .....................................................................................116
Columns Property (Array).................................................................................117
Command Property..........................................................................................117
CommandButtonFunctionKeyMode Property.......................................................118
CommandLine Property....................................................................................118
CommandText Property ...................................................................................119
CommandType Property...................................................................................119
CommitMode Property .....................................................................................120
ConcurrencyCursor Property .............................................................................120
Condition Property...........................................................................................121
Connection Property ........................................................................................121
ConnectionString Property................................................................................122
ConnectionTimeout Property ............................................................................122
ConnectMode Property.....................................................................................123
Container Property ..........................................................................................124
ControlBox Property.........................................................................................124
Controls Property ............................................................................................125
PowerCOBOL Reference 9
Count Property................................................................................................125
CurFieldNo Property.........................................................................................126
CurrencySign Property .....................................................................................126
CurrentPage Property ......................................................................................127
CursorLocation Property...................................................................................127
CursorType Property........................................................................................128
DataBase Property...........................................................................................129
DataBindings Property .....................................................................................129
DataColor Property (Array)...............................................................................130
DataCount Property .........................................................................................130
DataField Property...........................................................................................131
DataMember Property......................................................................................131
DataSource Property........................................................................................132
DateFormat Property .......................................................................................133
DateStyle Property ..........................................................................................134
DDEData Property ...........................................................................................135
DDEDataLength Property .................................................................................135
DDEDataOffset Property...................................................................................136
DDEDataStyle Property ....................................................................................136
DDEFormat Property........................................................................................137
DDEItem Property ...........................................................................................137
DDELinkStyle Property .....................................................................................138
DDEService Property........................................................................................138
DDETimeOut Property......................................................................................138
DDETopic Property ..........................................................................................139
DecimalPointIsComma Property ........................................................................139
DecisionMaxString Property ..............................................................................140
Default Property ..............................................................................................141
DefaultRowHeight Property ..............................................................................141
DelayedFocusEvent Property ............................................................................142
Device Property...............................................................................................142
Diffuse Property ..............................................................................................143
DisabledFocusAction Property...........................................................................143
DisabledImageList Property ..............................................................................144
DisabledImageType Property............................................................................144
DisplayRate Property .......................................................................................145
10 PowerCOBOL Reference
DisplayText Property........................................................................................145
DisplayText Property (ListItem) ........................................................................146
Divider Property ..............................................................................................146
Driver Property................................................................................................147
DropEnabled Property......................................................................................147
EdgeStyle Property ..........................................................................................148
EditableLabel Property .....................................................................................148
EditWhenGotFocus Property .............................................................................149
Element Property.............................................................................................149
Enabled Property.............................................................................................150
EnableOwnerName Property.............................................................................150
Expanded Property ..........................................................................................151
ExpandedImageIndex Property.........................................................................151
FileName Property ...........................................................................................151
FileType Property ............................................................................................152
FillColor Property .............................................................................................152
FillStyle Property .............................................................................................153
Font Property..................................................................................................154
ForeColor Property ..........................................................................................155
FramePath Property.........................................................................................156
FrameStyle Property ........................................................................................156
Ghosted Property ............................................................................................157
GraphStyle Property.........................................................................................157
HeaderText Property .......................................................................................157
HeadText Property ..........................................................................................158
Height Property...............................................................................................158
Hidden Property ..............................................................................................159
HideSelection Property.....................................................................................159
Highlight Property ...........................................................................................160
HighlightColor Property ....................................................................................161
HotImageList Property .....................................................................................162
HScrollBar Property .........................................................................................162
Icon Property ..................................................................................................163
IconIndex Property..........................................................................................163
IconName Property..........................................................................................164
Icons Property ................................................................................................164
PowerCOBOL Reference 11
ImageCount Property.......................................................................................165
ImageHeight Property......................................................................................165
ImageIndex Property.......................................................................................166
ImageLeft Property..........................................................................................166
ImageList Property ..........................................................................................167
ImageMode Property .......................................................................................167
ImageName Property.......................................................................................168
ImageTop Property..........................................................................................168
ImageWidth Property.......................................................................................169
IMEMode Property...........................................................................................169
Indentation Property........................................................................................170
Index Property ................................................................................................170
InputFormat Property ......................................................................................171
Interval Property .............................................................................................172
IsCheckBtn Property ........................................................................................173
IsChecked Property .........................................................................................173
IsQuery Property .............................................................................................174
IsSelected Property (Array) ..............................................................................174
Italic Property .................................................................................................175
Item Property (Array or object name) ...............................................................175
KeysetSize Property .........................................................................................176
LabelEdit Property ...........................................................................................176
LabelWrap Property .........................................................................................177
LargeStep Property..........................................................................................177
Layout Property...............................................................................................178
Left Property...................................................................................................178
LeftMargin Property .........................................................................................179
ListCount Property...........................................................................................179
ListIndex Property ...........................................................................................179
ListItems Property (Array) ................................................................................180
ListString Property (Array)................................................................................180
LockType Property...........................................................................................181
Lower Property ...............................................................................................181
LVStyle Property..............................................................................................182
Max Property ..................................................................................................182
MaxButton Property.........................................................................................183
12 PowerCOBOL Reference
MaxLength Property ........................................................................................183
MediaLength Property......................................................................................184
MediaLength Sample Code ...............................................................................184
MediaPosition Property ....................................................................................185
MenuBarName Property ...................................................................................185
MenuBreak Property ........................................................................................186
Min Property ...................................................................................................186
MinButton Property..........................................................................................187
MouseIconName Property ................................................................................187
MousePointer Property.....................................................................................188
Moveable Property...........................................................................................189
MultiLine Property ...........................................................................................189
MultipleInstance Property.................................................................................190
MultiSelect Property.........................................................................................190
Name Property ................................................................................................191
Normal Property ..............................................................................................191
Numeric Property (ExcelConnection) .................................................................192
Numeric Property (ListItem) .............................................................................192
OptionButtonClickMode Property.......................................................................193
Orientation Property ........................................................................................193
PageCaption Property (Array) ...........................................................................194
PageCount Property.........................................................................................194
PageNoFormat Property ...................................................................................194
PageTooltip Property (Array) ............................................................................195
PaperOrientation Property ................................................................................195
PaperScaleUnit Property...................................................................................196
PaperType Property .........................................................................................196
Parent Property ...............................................................................................197
Password Property...........................................................................................198
PasswordChar Property ....................................................................................199
Path Property..................................................................................................199
PathSeparator Property....................................................................................200
Pattern Property..............................................................................................200
PcdColorType Property.....................................................................................201
PcdResolution Property ....................................................................................201
PictureString Property ......................................................................................202
PowerCOBOL Reference 13
Printable Property............................................................................................202
PrintDate Property...........................................................................................203
PrinterName Property ......................................................................................203
PrintTitle Property ...........................................................................................203
PropertyName Property....................................................................................204
PunchMargin Property......................................................................................204
QueryString Property .......................................................................................204
RangeSelect Property ......................................................................................205
Rate Property..................................................................................................205
ReadOnly Property ..........................................................................................206
Receive Property .............................................................................................206
RecordForm Property.......................................................................................207
Recordset Property ..........................................................................................207
RenderStyle Property .......................................................................................208
RenderText Property........................................................................................209
Repeat Property ..............................................................................................209
Resource Property ...........................................................................................210
RestoreFocusWhenEnablingForm Property .........................................................210
ReturnWhenEnterKey Property .........................................................................211
ReturnWhenLostFocus Property ........................................................................211
ReturnWhenMaxText Property ..........................................................................212
RightMargin Property .......................................................................................212
Root Property (Array) ......................................................................................213
Row Property ..................................................................................................213
RowCaption Property .......................................................................................213
RowCount Property .........................................................................................214
Scalable Property ............................................................................................214
Scale Property.................................................................................................215
ScaleMode Property .........................................................................................215
ScalingStyle Property .......................................................................................216
ScrollLock Property ..........................................................................................217
ScrollPage Property .........................................................................................217
Selected Property ............................................................................................218
SelectedImageIndex Property...........................................................................218
SelectEnd Property ..........................................................................................218
SelectStart Property.........................................................................................219
14 PowerCOBOL Reference
SelectText Property .........................................................................................219
SelField Property (Array) ..................................................................................220
SelItem Property .............................................................................................220
SelItemIndex Property .....................................................................................221
SelNode Property ............................................................................................221
SelString Property ...........................................................................................222
ShapeStyle Property ........................................................................................222
ShowExcel Property .........................................................................................223
ShowStatusbar Property...................................................................................223
ShowToolTips Property ....................................................................................224
Size Property ..................................................................................................224
SmallIconIndex Property ..................................................................................224
SmallIcons Property.........................................................................................225
SmallStep Property ..........................................................................................225
Smooth Property .............................................................................................226
SortColumn Property .......................................................................................226
Sorted Property...............................................................................................227
SortKind Property ........................................................................................227
SortOrder Property ..........................................................................................228
Source Property ..............................................................................................228
StartUpPosition Property ..................................................................................229
StatusText Property.........................................................................................229
Step Property..................................................................................................230
Strikethrough Property.....................................................................................230
Style Property .................................................................................................231
System Property..............................................................................................232
TabFixedHeight Property..................................................................................232
TabFixedWidth Property...................................................................................233
TabGroup Property ..........................................................................................233
TabIndex Property...........................................................................................234
TableCells Property (Two-Dimensional-Array) ....................................................235
TableColumns Property (Array).........................................................................235
TabStop Property ............................................................................................236
TabWidthStyle Property ...................................................................................236
TargetName Property ......................................................................................237
TargetType Property........................................................................................237
PowerCOBOL Reference 15
Text Property ..................................................................................................238
Text Property (ExcelConnection).......................................................................239
Text Property (ListItem)...................................................................................239
TextCase Property ...........................................................................................240
ThreeStates Property .......................................................................................240
ThumbVisible Property .....................................................................................241
TickCount Property ..........................................................................................241
TickFrequency Property....................................................................................242
TickPosition Property (Array) ............................................................................242
TickStyle Property ...........................................................................................243
TimeFormat Property .......................................................................................244
TitleBar Property .............................................................................................245
ToolboxBitmap Property...................................................................................245
TooltipText Property ........................................................................................246
Top Property...................................................................................................247
TopMargin Property .........................................................................................247
Topmost Property............................................................................................248
TotalCount Property ........................................................................................248
TVLineStyle Property .......................................................................................249
TVStyle Property .............................................................................................249
UnacceptableDefault Property...........................................................................250
Underline Property...........................................................................................250
Upper Property................................................................................................251
UseCaption Property ........................................................................................251
UseControlWindow Property .............................................................................251
UseDefaultDate Property..................................................................................252
UseMnemonic Property ....................................................................................252
UsePalette Property .........................................................................................253
UserID Property ..............................................................................................253
UserName Property .........................................................................................254
UseSystemColor Property .................................................................................254
Value Property ................................................................................................255
Value Property (Graph) ....................................................................................256
ValueTips Property ..........................................................................................257
Visible Property ...............................................................................................257
VScrollBar Property..........................................................................................258
16 PowerCOBOL Reference
Weight Property ..............................................................................................258
Width Property................................................................................................259
WindowAdjustment Property ............................................................................260
WindowState Property .....................................................................................260
WordWrap Property .........................................................................................261
Wrapable Property...........................................................................................261
Writable Property ............................................................................................261
PowerCOBOL Reference 17
Delete Method ................................................................................................280
DeleteCurRecord Method .................................................................................281
DeleteRecord Method ......................................................................................281
DeleteString Method ........................................................................................282
DeleteTick Method...........................................................................................282
DisableCommit Method ....................................................................................283
Disconnect Method ..........................................................................................283
DisplayMessage Method ...................................................................................284
DoModal Method .............................................................................................286
DoModal2 Method ...........................................................................................287
EnableCommit Method .....................................................................................287
End Method ....................................................................................................288
EnsureVisible Method.......................................................................................288
Execute Method ..............................................................................................289
ExecuteDDECommand Method .........................................................................291
ExecuteProcedure Method................................................................................292
ExecuteSync Method........................................................................................293
GetFileName Method .......................................................................................294
GetFolderName Method ...................................................................................295
GetHotData Method.........................................................................................296
GetScreenSize Method .....................................................................................297
GetWorkArea Method.......................................................................................298
InitiateDDE Method .........................................................................................299
Insert Method .................................................................................................300
InsertListItem Method .....................................................................................301
InsertString Method.........................................................................................302
IsCallerInRole Method......................................................................................302
IsInTransaction Method ...................................................................................303
IsSecurityEnabled Method ................................................................................303
LoadFile Method..............................................................................................304
Move Method ..................................................................................................305
MoveForm Method...........................................................................................306
NewBook Method ............................................................................................307
OpenBook Method ...........................................................................................308
OpenDB Method ..............................................................................................309
OpenDDE Method............................................................................................309
18 PowerCOBOL Reference
OpenDevice Method ........................................................................................309
OpenForm Method...........................................................................................310
PauseAnimation Method...................................................................................311
PauseDevice Method........................................................................................312
PlayAnimation Method .....................................................................................312
PlayDevice Method ..........................................................................................312
PlaySound Method...........................................................................................313
PokeData Method ............................................................................................313
PopupMenu Method.........................................................................................314
PrintForm Method............................................................................................315
ProgressStep Method.......................................................................................315
ReadFirstRecord Method ..................................................................................315
ReadLastRecord Method ..................................................................................316
ReadNextRecord Method..................................................................................316
ReadPreviousRecord Method ............................................................................316
Refresh Method...............................................................................................317
RequestData Method .......................................................................................317
ResumeDevice Method.....................................................................................318
RewriteCurRecord Method................................................................................319
RewriteRecord Method.....................................................................................319
RollbackDB Method..........................................................................................320
SaveAsBook Method ........................................................................................321
SaveBook Method............................................................................................321
SaveFile Method..............................................................................................322
SelectCell Method ............................................................................................322
SelectRecords Method......................................................................................323
SetAbort Method .............................................................................................324
SetComplete Method .......................................................................................324
SetFocus Method.............................................................................................324
SetMCICommand Method.................................................................................325
SetPage Method ..............................................................................................326
SetPrinter Method ...........................................................................................326
ShowForm Method ..........................................................................................327
Start Method...................................................................................................327
StartEdit Method .............................................................................................328
StopDevice Method..........................................................................................328
PowerCOBOL Reference 19
TerminateDDE Method.....................................................................................328
ThruEvents Method .........................................................................................329
UnadviseDDE Method ......................................................................................332
UpdateRecord Method .....................................................................................333
Examples of the UpdateRecord Method .............................................................333
WriteRecord Method ........................................................................................334
ZOrder Method................................................................................................335
20 PowerCOBOL Reference
MouseMove Event ...........................................................................................353
MouseUp Event ...............................................................................................354
MoveComplete Event .......................................................................................355
NodeClick Event ..............................................................................................356
Opened Event .................................................................................................356
PathChange Event ...........................................................................................356
PatternChange Event .......................................................................................357
PowerBroadcast Event .....................................................................................357
PreKeyDown Event ..........................................................................................358
PreKeyPress Event...........................................................................................359
PreKeyUp Event ..............................................................................................360
QueryClose Event ............................................................................................361
RecordChangeComplete Event..........................................................................361
RecordsetChangeComplete Event......................................................................362
Resized Event .................................................................................................363
Return Event...................................................................................................363
SelChange Event .............................................................................................365
Select Event....................................................................................................365
SelectClose Event ............................................................................................365
StartAnimation Event .......................................................................................365
Stepped Event.................................................................................................366
Timer Event ....................................................................................................366
WillChangeField Event......................................................................................366
WillChangeRecord Event ..................................................................................367
WillChangeRecordset Event ..............................................................................368
WillMove Event ...............................................................................................369
PowerCOBOL Reference 21
adReason Parameter (Events of the ADODataSource Control) ............................382
adStatus Parameter (Events of the ADODataSource Control)..............................383
Align Property .................................................................................................383
Alignment Property (CheckBox, OptionButton) ...................................................383
Alignment Property (Column, TextBox ).............................................................383
Alignment Property (Frame) .............................................................................383
Alignment Property (Frame, StaticText, TableColumn) ........................................384
Appearance Property .......................................................................................384
Arrange Property .............................................................................................384
BackStyle Property (Shape) ..............................................................................384
BackStyle Property (Shape, TextBox, Others).....................................................384
BorderStyle Property (Form).............................................................................385
BorderStyle Property (Frame/Shape/Others) ......................................................385
BorderStyle Property (Shape) ...........................................................................385
ColorMap Property...........................................................................................385
CommandButtonFunctionKeyMode ....................................................................385
CommandType Property...................................................................................386
CommitMode Property .....................................................................................386
ConcurrencyCursor Property .............................................................................386
ConnectMode Property.....................................................................................386
CursorLocation Property...................................................................................386
CursorType Property (ADODataSource) .............................................................387
CursorType Property (DBAccess) ......................................................................387
DateStyle Property ..........................................................................................387
DDEDataStyle Property ....................................................................................387
DDELinkStyle Property .....................................................................................387
DisabledFocusAction Property...........................................................................387
DisabledImageType Property............................................................................388
EdgeStyle Property ..........................................................................................388
FileType Property ............................................................................................388
FillStyle Property .............................................................................................388
FrameStyle Property ........................................................................................388
GraphStyle Property.........................................................................................389
Icon Property ..................................................................................................389
ImageMode Property .......................................................................................389
IMEMode Property...........................................................................................389
22 PowerCOBOL Reference
Layout Property...............................................................................................390
LockType Property...........................................................................................390
LVStyle Property..............................................................................................390
MenuBreak Property ........................................................................................390
MouseButton Parameter (MouseDown, MouseMove, MouseUp events).................390
MousePointer Property.....................................................................................391
MultiSelect Property (FileList/ListBox)................................................................391
OptionButtonClickMode Property.......................................................................391
Orientation Property (Others) ...........................................................................391
Orientation Property (Tab) ...............................................................................392
PageNoFormat Property ...................................................................................392
PaperOrientation Property ................................................................................392
PaperScaleUnit Property...................................................................................392
PaperType Property .........................................................................................392
PcdColorType Property.....................................................................................393
PcdResolution Property ....................................................................................393
RenderStyle Property .......................................................................................393
ScaleMode Property ScaleModeIn/ScaleModeOut Parameters (ConvertScale
method), ScaleMode Parameters (GetScreenSize/GetWorkArea methods) ...........393
ScalingStyle Property .......................................................................................394
ShapeStyle Property ........................................................................................394
ShiftState Parameter (KeyDown, KeyUp, PreKeyDown, PreKeyUp, MouseDown,
MouseMove, MouseUp events) .........................................................................394
SortKind Property ............................................................................................394
SortOrder Property ..........................................................................................394
Source Property ..............................................................................................395
StartUpPosition Property ..................................................................................395
Style Property (Button) ....................................................................................395
Style Property (ComboBox) ..............................................................................395
Style Property (Tab) ........................................................................................395
Style Property (Toolbar)...................................................................................395
TabWidthStyle Property ...................................................................................396
TargetType Property........................................................................................396
TextCase Property ...........................................................................................396
TickStyle Property ...........................................................................................396
TimeFormat Property .......................................................................................396
PowerCOBOL Reference 23
TVLineStyle Property .......................................................................................396
TVStyle Property .............................................................................................397
Value Property (CheckBox)...............................................................................397
Weight Property ..............................................................................................397
WindowAdjustment Property ............................................................................397
WindowState Property .....................................................................................397
Zorder Method ................................................................................................398
Index .........................................................................................................405
24 PowerCOBOL Reference
Chapter 1. Introduction
This chapter gives an introduction to PowerCOBOL and this reference manual. It
covers:
• Overview of PowerCOBOL
• An overview of this manual
• Upgrading from earlier releases
Overview of PowerCOBOL
PowerCOBOL is a graphical application development tool for COBOL programmers.
The PowerCOBOL development environment allows programmers to use their
existing COBOL knowledge to build and execute complex graphical user interface
(GUI) applications in the Microsoft Windows environment.
PowerCOBOL simplifies the process of programming for event-driven object-oriented
applications and abstracts Windows APIs to a higher level. It enables programmers
to perform all of the steps associated with developing complex, graphical,
client/server, Windows applications.
With PowerCOBOL, you can:
• Develop graphical user interface (GUI) applications
• Include event-driven programming objects
• Enhance applications with standard COBOL syntax
• Connect to other tools
• Develop multimedia applications
• Develop client/server applications
• Develop applications that interact with other open object environments
• Create OLE, ActiveX and COM components
Updates to Terminology
The following terms have been changed between earlier versions and PowerCOBOL
4.0 and later.
Earlier Term PowerCOBOL 4.0 (and onwards) Term
Attribute Property
Bitmap Button Merged into the CommandButton Control
Check Button Item CheckBox Control
Combo Box Item ComboBox Control
Date Item Merged into the StaticText Control
DB Access Item DBAccess Control
DDE Item DDE (Dynamic Data Exchange) Control
Directory List Item FolderList Control
Drive List Item DriveList Control
Edit Item TextBox Control
EXCEL Connection Item ExcelConnection Control
Extend Image Item Merged into the Image Control
File List Item FileList Control
Function Key Item Merged into the CommandButton Control
Graph Item Graph Control
Group Box Item GroupBox Control or Frame Control
Horizontal Scroll Bar Item ScrollBar Control
Image Item Image Control
Item Control
Label Item StaticText Control
List Box Item ListBox Control
MCI Item MCI (Multimedia Control Interface) Control
Menu Item Menu Object
Metafile Item Merged into the Image Control
OLE Item None
PICTURE Edit Item Merged into the StaticText Control
Print Item Print Control
Push Button Item CommandButton Control
Radio Button Item OptionButton Control
Rectangle Item Shape Control
Selection Box Item Merged into the ComboBox Control
Sheet Form
Simple Animation Item Animation Control
Sound Item Merged into the MCI Control
Table Item Table Control
Timer Item Timer Control
Vertical Scroll Bar Item ScrollBar Control
28 Chapter 1. Introduction
Naming Attributes
In earlier versions of PowerCOBOL, attributes used PowerCOBOL-specific names like
"POW-TEXT". Because they were specific to PowerCOBOL, the designers could
ensure that there was no conflict with COBOL reserved words. Attributes (or
properties) were referred to using syntax of the style:
However, with the introduction of support for ActiveX controls that can be created
outside the COBOL "world", there is now no way to ensure there is no conflict with
COBOL reserved words. PowerCOBOL therefore uses the following style of syntax for
referring to properties:
Invoking Methods
In earlier versions of PowerCOBOL methods were CALLed using syntax of the style:
PowerCOBOL 4.0 and later use the object-oriented COBOL syntax for invoking
methods, namely:
The topics defining the objects describe the purpose of the object, and list the
object's properties, methods, and events.
Forms
The form itself is essentially a control. However, because it cannot be placed directly
on another form (you have to create an OCX control containing the form) and is not
one of the controls in the Form Editor Toolbox, it is described in this reference as the
Form "object". Otherwise there is nothing significant that makes the form an "object"
rather than a "control".
Containers
There are two container objects - the Form object and the GroupBox control - in
which controls are placed. Some properties and method arguments may change
depending on the properties of the containing object. For example, the current Font
property of the Form object defines the initial value of the Font property of a new
control placed on the form.
Note that, although the Frame, Tab and Toolbar controls can contain other controls,
the other controls do not inherit default properties or method arguments from them.
Chapter 2. Objects 33
Button Object
Description: Button objects contain information about Toolbar buttons.
The objects are referenced by using the Buttons property - an array of pointers to
the button objects. For example, to set the Caption property of the second button on
a toolbar called "Toolbar1" you would code:
MOVE BUTTON-CAPTION(2)
TO "Caption" OF BUTTONS(2) OF Toolbar1
Events: None
Corresponding None
Object in
PowerCOBOL
V3.0 or earlier:
Column Object
Description: The Column object is used to contain information about columns in the detail view of
the ListView control.
The Column object contains the width of the column, the header text, and the
editing and alignment characteristics of the items listed in the column.
Events: None
Corresponding None
Object in
PowerCOBOL
V3.0 or earlier:
34 Chapter 2. Objects
DataBinding Object
Description: DataBinding objects define the data binding properties for Custom controls that can
bind data.
A DataBinding object corresponds to a property of the custom control. The property
has to be set up by the creators of the custom control to support data binding.
There is one DataBinding object for each property that can have data binding.
Events: None.
Corresponding None.
PowerCOBOL
V3.0 Items:
Chapter 2. Objects 35
Details: The DataBindings collection object is pointed at by the DataBindings property of the
Custom control. The DataBindings property only exists in custom controls that
support data binding (this is determined by the creators of the custom control).
You refer to the DataBinding objects by using the Item property of the
DataBindings collection object.
For example, if you want to connect the ListText property of a custom control
(called DataList1 which, of course, must support data binding) to the "Product" data
field, code as follows:
MOVE "Product" TO "DataField"
OF "Item"("ListText")
OF "DataBindings" OF DataList1
In this code, the part {OF "DataBindings" OF DataList1} defines the DataBindings
collection object. And the part {"Item"("ListText") OF "DataBindings" OF DataList1}
defines the DataBinding object.
If you know the ordinal position of the DataBinding object within the DataBindings
collection object, for example if the desired property corresponds to the third
DataBinding object, you could code:
MOVE "Product" TO "DataField"
OF "Item"(3)
OF "DataBindings" OF DataList1
The total number of DataBinding objects is contained in the Count property.
For example, you can obtain the number of DataBinding objects by coding:
MOVE "Count" OF "DataBindings" OF DataList1
TO ...
Notes The operation of the DataBindings collection object is different from that of other
objects such as ListItem, Node, etc. The pointer to the DataBinding object must be
obtained using the Item property. So, you CANNOT write:
MOVE "Product" TO "DataField"
OF "DataBindings"("BoundText") << WRONG!!
OF DataList1
MOVE "Product" TO "DataField"
OF "DataBindings"(3) << WRONG!!
OF DataList1
Properties: Count Item
Methods: None.
Events: None.
Corresponding None.
PowerCOBOL
V3.0 Items:
36 Chapter 2. Objects
Font Object
Description: Font objects contain the properties of the font to be used for character strings in
controls.
Font objects have the font name, point size, and related attributes such as bold,
underscore etc.
Details:
Using font objects: You access a Font object as if it is one of the properties of the control.
For example to set the font size of a StaticText control to 20 you code the following:
If you attempt to set a value that is not supported, for example a font size less than
8 points, the system substitutes a correct value.
And if you attempt to set a property that is not supported by the current font, for
example the Bold property, the system substitutes a font that does support Bold.
Events: None
Corresponding The attributes related to fonts, for example POW-FONTSIZE and POW-ITALIC,
Element in associated with each item.
PowerCOBOL
V3.0 or earlier:
Chapter 2. Objects 37
Form Object
Description: Form objects define the windows of PowerCOBOL applications. They are the
containers in which you place controls. They define default properties, support
window-related methods and receive window-directed events.
Notes: You close forms using the CloseForm or Deactivate method. Do not invoke other
methods after invoking these methods.
Sample images:
ListItem Object
Description: The ListItem object contains the information relating to a line in the detail view of
the ListView control, when the LVStyle property is "3 - Report".
It specifies the icon, text strings, selected status and icon appearance.
Details: ListItem objects are referenced using the ListItems of the ListView control.
For example to get the text string of the first line, you code the following:
Menu Object
Description: Menu objects are containers for the MenuItem objects that make up menubars and
popup menus.
MenuItem Object
Description: Each MenuItem object defines an entry in a menu. This can be a top-level menu, a
dropdown menu, a cascaded menu or a popup menu.
Details: MenuItem objects are treated as properties of the parent Menu or MenuItem object.
To set the Caption property, you code the following:
Note: If you set the MenuItem Kind to "0 - Frame Left Menu", "2 - Frame Center Menu" or
"4 - Frame Right Menu" in the MenuItem property page, you cannot change the
Visible property of the MenuItem object and its child Menuitem objects at execution
time.
Properties: Caption Enabled Name
Check MenuBreak Visible
Methods: None
Events: Click Select
Corresponding Menu item.
Element in
PowerCOBOL
V3.0 or earlier:
Node Object
Description: The Node object contains information relating to an item in the detail view of the
TreeView control. This includes a pointer to the image to be used, the text string to
be displayed, and pointers to related Node objects.
Details: You access a Node object as if it is one of the properties of a TreeView control or a
parent Node object.
For example to get the text string of the first root node object, you code the
following:
RenderText Object
Description: The RenderText object provides editing of character strings in certain controls where
text is entered or displayed.
Details:
Using RenderText RenderText objects take the character string for the control and edit it according to a
objects: COBOL picture or date format. You can also select that no editing is performed.
You treat RenderText objects as properties of the containing control. For example, to
refer to the CurrencySign for the RenderText object in a TextBox control, you code
the following:
MOVE "CurrencySign" OF "RenderText"
OF TextBox1
TO ...
Properties: BlankSuppress DateStyle PictureString UseDefaultDate
CurrencySign DecimalPoint-IsComma RenderStyle
DateFormat InputFormat
Methods: None
Events: None
Corresponding The COBOL-PICTURE attribute of PICTURE Edit Item.
Element in The Date Style of the Date Item.
PowerCOBOL
V3.0 or earlier:
TableCell Object
Description: TableCell objects contain the properties for cells in Table control objects.
Details:
Using TableCell TableCell objects are always referred to using the TableCells property (a pointer to
objects: the TableCell object, held in a two-dimensional array). For example to set the text in
the cell at row 3, column 5 code:
TableColumn Object
Description: The TableColumn object defines the framework of the Table control. For example:
the width of the columns and how the text should be displayed.
Details:
Using TableColumn objects are always referred to using the TableColumns property (a
TableColumn pointer to the TableColumn object, held in an array). For example to set the width of
objects: column 3 code to 1500 (assuming ScaleMode is set to 3 – 1/20 points):
ADODataSource Control
Description: ADODataSource control gives access to database using ADO (Microsoft ActiveX Data
Objects).
Sample Image:
This image is only visible at design time. The ADODataSource control is invisible at
execution time.
Properties: Array Connection CursorType Password
ClassMajorVersion ConnectionString Index Recordset
ClassMinorVersion ConnectionTimeout Left ScaleMode
ClassProgID ConnectMode LockType Top
CommandText Container Name UserName
CommandType CursorLocation Parent
In addition to the above properties, you can also use the properties of the ADO
connection object and ADO recordset object. These are documented in Microsoft's
MSDN Library, available online at http://msdn.microsoft.com.
Methods: None.
But, you can use the methods of the ADO connection object and ADO recordset
object. These are documented in Microsoft's MSDN Library, available online at
http://msdn.microsoft.com.
For example, the syntax for invoking the XXXX method of the ADO recordset
object is:
INVOKE "Recordset" OF ADODataSource "XXXX" USING ..
Animation Control
Description: The Animation control displays a series of bitmap images at preset intervals. By using
slightly different bitmaps you can obtain the appearance of movement ("animation").
Notes:
1. Using many large images in an animation or shortening the intervals can affect
performance.
2. When the Animation control is printed by the Print control, it can only be printed
at an enlargement Rate of 100%.
Sample image:
CheckBox Control
Description: CheckBoxes are used for selections. They can either be on (selected) or off (not
selected). Use CheckBoxes for independent or nonexclusive choices; use
OptionButtons for exclusive choices.
PowerCOBOL lets you specify a third state in which the CheckBox is checked with a
grayed check mark.
Sample image:
ComboBox Control
Description: A ComboBox combines a text box with a list box. Text can be entered in the text box
part or selected from the list box part.
There are three styles of ComboBoxes:
• Simple
• DropDown
• DropDownList
Sample images:
(2)
48 Chapter 3. Controls
Details:
File formats: Data for the lists can be loaded from text files, CSV (Comma Separated Values) files,
and fixed text format files.
Text files – As created with text editors like Notepad. Records are separated by
carriage return, line feed bytes.
CSV files – Text files with fields separated by commas.
Fixed Length format files – Files with fixed length records not separated by any
special characters.
Fields: CSV and Fixed Length formats allow you to select a particular field from the records
to display in the list. Define the fields for Fixed Text format files using the
RecordForm property.
Only one field can be displayed at a time. Specify the field to be displayed using the
CurFieldNo property.
Records: For Simple and DropDown styles you can access the whole of the record, whose field
value is selected in the list box part.
Filtered list: For Simple and DropDown styles the values in the list box can be limited to match
the characters in the text box part. When the IsQuery property is set to True, the list
box part only displays items that start with the characters entered in the text box
part.
When users want to display all the items in the list (i.e. clear the filter), they should
delete all the text in the text box part and press the ENTER key.
Properties: Array FileType ListString Sorted
AutoLoadFile Font Name Style
AutoSize ForeColor Parent TabGroup
BackColor HeightHighlight Printable TabIndex
ClassMajorVersion HighlightColor QueryString TabStop
ClassMinorVersion IMEMode RecordForm Text
ClassProgID Index RenderText ToolTipText
Container IsQuery ScaleMode Top
CurFieldNo Left ScalingStyle Visible
Enabled ListCount SelField Width
FileName ListIndex SelString
Methods: AddString InsertString Refresh SetFocus
ClearList LoadFile SaveFile ZOrder
DeleteString Move
Events: Change GotFocus LostFocus Return
Click KeyDown MouseDown SelChange
DblClick KeyPress MouseMove
Edit KeyUp MouseUp
Class ProgID Fujitsu.PcobComboBox.4
name:
Corresponding Combo Box Item
Controls in Selection Box Item
PowerCOBOL
V3.0 or earlier:
Chapter 3. Controls 49
CommandButton Control
Description: A CommandButton is a push button control displaying text and/or an image. It is
depressed using the left mouse button, or can be activated by an assigned function
key.
Sample image:
Details:
Shortcut keys: PowerCOBOL lets you assign function keys to CommandButtons as shortcut keys.
Note:
• You need to be careful not to use function keys already assigned by the
Windows system.
That the focus does not move to the CommandButton when the shortcut key is used.
Default Button You can set a CommandButton to be the default button. The default button is the
one that receives a Click event when you push the Enter key. For example, it is often
helpful to make the OK button the default button.
A CommandButton becomes the default button when one of the following is the
case:
- The Default property is True.
- The CommandButton has the focus.
Note: If the UnacceptableDefault property is True, you cannot change the Default
property to True – so the CommandButton cannot become the default button.
Refer to the descriptions of the Default property and the Click event for details.
Cancel Button You can set a CommandButton to be the cancel button. The cancel button is the one
that receives a Click event when you push the Esc key. For example, it is usually
helpful to make the CommandButton with the text "Cancel" the cancel button.
Refer to the descriptions of the Cancel property and the Click event for details.
Properties: Array DisabledImage- Layout TabIndex
BackColor Type Left TabStop
Cancel Enabled Name ToolTipText
Caption Font Parent Top
ClassMajorVersion ForeColor Printable UnacceptableDefault
ClassMinorVersion Height RenderText UseSystemColor
ClassProgID Highlight Resource Visible
ColorMap HighlightColor ScaleMode Width
Container ImageName ScalingStyle
Default Index TabGroup
Methods: Move Refresh SetFocus ZOrder
Events: Click KeyPress MouseDown
GotFocus KeyUp MouseMove
KeyDown LostFocus MouseUp
Class ProgID Fujitsu.PcobCommandButton.4
name:
Corresponding Control in Push Button Item Bitmap Button Item Function Key Item
PowerCOBOL V3.0 or earlier:
50 Chapter 3. Controls
Custom Control
Description: A Custom control is an OLE (ActiveX) control from a third party, or an ActiveX control
created by PowerCOBOL.
PowerCOBOL makes the control's properties, methods and events accessible to
PowerCOBOL procedures.
Refer to the manuals supplied with your custom control for specific details.
DBAccess Control
Description: The DBAccess control gives access to ODBC (Open Database Connectivity)
databases.
Sample image:
- Read only
If the data does not need to be updated, select Read only.
- Cursor Concurrency
Specifying a value other than READONLY enables updating and deleting the
current data using the cursor. Some options may not operate correctly
because of the manner in which the ODBC driver functions.
6. Apply your changes
Select the "Apply" button to save the information you have set.
7. Close the Property page
Select the "OK" button and close the property page.
Executing Procedures
You can execute procedures in the data source by using the ExecuteProcedure
method.
Specify procedures and fields to be processed in the DBAccess property page by
following the steps outlined below:
1. Set TargetType
Select "Procedure".
2. Select the Data Source to connect to.
Select the "Connect" button and set the requested information such as data
source name and database.
3. Select the target procedure.
Select the "Target" button and select the procedure name to be processed.
4. Select Fields
Select the "Fields" button and the result field name to be processed (in the case
of the procedure to create the result set). The parameter field and return value
field are selected automatically. Fields shown with an arrow pointing right are
input parameters, fields shown with an arrow pointing left are output
parameters and fields shown with an arrow pointing right and left are
input/output parameters.
5. Set other information
Select the "Others" button and set the following information:
- Setting cursor type
Select the appropriate setting in the "Cursor type" group box. The choices
other than FORWARD_ONLY also enable reading forward. Some options may
not operate correctly because of the manner in which the ODBC driver
functions.
- Selecting commit mode
Select the appropriate setting in the "Commit mode" group box.
6. Apply your changes
Select the "Apply" button to save the information you have set.
7. Close the Property page
Select the "OK" button and close the property page.
54 Chapter 3. Controls
Sample image:
DriveList Control
Description: DriveList is a combo box containing a list of the available drives.
Sample image:
Edit Control
Description: The Edit control provides text entry and editing functions. It offers only single line
entry.
The Edit control is a lightweight version of the TextBox control, and does not provide
the RenderText property for formatting the entered character string. It does,
however, support some features not supported by the TextBox control, namely being
able to bind the control to an ADODataSource control (using the DataSource,
DataMember and DataField properties, and UpdateRecord method) and has the
ReturnWhen… properties.
See the ADODataSource.ppj sample in the Edit subfolder of the PowerCOBOL
samples folder for an example of connecting the Edit control to the data of an
ADODataSource control.
Sample image:
ExcelConnection Control
Description: The ExcelConnection control provides functions for exchanging data with Microsoft
Excel.
Sample image:
FileList Control
Description: The FileList control is a list box containing a list of the files in the current folder.
It can be used in conjunction with the DriveList and FolderList controls to help users
select a file.
Sample image:
FolderList Control
Description: The FolderList control is a list box containing the folders on the current drive. It can
be used in conjunction with the DriveList and FileList controls to help users select
files. The SelString property contains the selected folder.
The Path property contains the path (relative to the current folder) of the currently
selected current folder.
A double click changes the current folder as well as the selected folder.
Sample image:
Frame Control
Description: The Frame control consists of a rectangular border and text. It is used for visually
collecting controls (such as OptionButton controls) into a logical group.
Sample image:
Details: The Frame control is similar to the GroupBox control; you place controls in it, but it
does not become the parent of those controls. The Frame control is a peer of the
controls in it. (Whereas the GroupBox control is a parent object for the controls in it.)
For example, to set the Value property for a CheckBox control within a Frame
control, you code as follows:
Graph Control
Description: The Graph control displays numeric data in graph form.
There are four graph styles available:
• Vertical bar chart
• Horizontal bar chart
• Line graph
• Pie chart
Use the DataColor property to configure different colors for different data.
Sample image:
GroupBox Control
Description: A GroupBox consists of a rectangular border and text. It is used for visually collecting
controls (e.g. OptionButton controls) into logical groups.
Sample image:
Details: The GroupBox control is a container for controls placed within it.
The controls are child objects of the GroupBox control.
For example, to refer to the Caption property of the StaticText control (Static1)
placed in the GroupBox control (Group1):
Image Control
Description: The Image control displays picture images from a variety of file types such as
bitmaps, Photo CD images, and Jpeg images.
The type of image file is determined by the extension.
Bitmap and Icon files can be built into the application as resources.
Sample image:
Details:
Supported image File description Extension(s)
formats: Bitmap files (Can be built into the application as resources) BMP, DIB, RLE
Icon files (Can be built into the application as resources) ICO, CUR
Metafiles (Supports standard metafiles and Aldus placeable WMF, EMF, CLP
metafiles)
JPEG files (Can be copied to the clipboard as .CLP files) JPG, JIF
Photo CD image files (Must be in the \Photo_cd\ folder, or in PCD
the \Photo_cd\Images folder on a Photo CD. Files must be
named "Imgnnnn.pcd", where nnnn is any number, or
"Overview.pcd".)
Notes: Large images require large quantities of memory to be displayed. If there is
insufficient memory it may not be possible to display the image.
On a 256 color Windows system, displaying multiple images that have 256 colors or
more on the same form may result in incorrect color displays.
Windows format meta files cannot have long file names.
Properties: Appearance Diffuse ImageName Printable
Array DropEnabled ImageTop Resource
BackColor Enabled ImageWidth ScaleMode
BackStyle Height Index ScalingStyle
BorderStyle ImageCount Left ToolTipText
ClassMajorVersion ImageHeight Name Top
ClassMinorVersion ImageIndex Parent Visible
ClassProgID ImageLeft PcdColorType Width
Container ImageMode PcdResolution
Methods: Move Refresh ZOrder
Events: Change DblClick MouseMove
Click MouseDown MouseUp
Class ProgID Fujitsu.PcobImage.4
name:
Corresponding Image Item
Control in ExtendedImage Item
PowerCOBOL
V3.0 or earlier: Metafile Item
64 Chapter 3. Controls
Label Control
Description: The Label control displays text that the user cannot edit.
The Label control is a lightweight version of the StaticText control, and does not
provide the RenderText property to format the character string.
Sample image:
ListBox Control
Description: The ListBox control presents a list of items from which the user can select one or
more items.
There are three styles:
Single Select: Only one item can be selected at a time.
Multiple Select: Several contiguous items can be selected.
Extended Select: Several contiguous and non-contiguous items can be selected.
You can also choose to include check boxes to the left of each item in the list.
Sample image:
ListView Control
Description: The ListView control displays lists of items. It offers four styles of display that can be
selected:
• Large icons
• Small icons left to right
• Small icons top to bottom
• Detail view offering several columns of information.
Column objects are used to describe the columns. ListItem objects contain the data
of the items to be listed.
Sample image:
Sample image:
OptionButton Control
Description: Option buttons are used for exclusive selections – where only one of a group of
choices can be selected at a time.
Sample image:
Print Control
Description: The Print control enables printing of the form at execution time.
Sample image:
ProgressIndicator Control
Description: The ProgressIndicator control displays a bar indicating the progress of an operation
such as copying large files.
The progress bar can be made up of several blocks or be a continuous "smooth" bar.
Sample image:
ScrollBar Control
Description: The ScrollBar control consists of a scroll box that slides within the scroll bar. Arrows
at either end allow for small step movement, and clicking in the scroll bar provides
large step movement.
Use ScrollBar controls to provide variable positioning within items too large to display
in the available space.
Sample image:
Shape Control
Description: The Shape control provides rectangular and elliptical shapes with a variety of border
and fill styles.
Sample image:
Slider Control
Description: The Slider control provides a sliding "thumb" for convenient input of variable
numbers.
The Slider control can display graduation marks ("ticks") and display a colored range
bar within the control.
Sample image:
StaticText Control
Description: The StaticText control displays text that the user cannot edit.
PowerCOBOL provides the ability to format the text according to standard COBOL
PICTUREs and date formats.
Sample image:
Tab Control
Description: The Tab control provides multiple pages on which other controls can be placed. The
user switches between pages by clicking on file-folder style tabs or "latching" buttons
(buttons that stay depressed to indicate an item is selected).
You can select a number of styles in the Tab control including: location of tabs, fixed
or variable width tabs, and single or multiple lines of tabs.
Sample images:
Details: Controls placed on the Tab control are at the same level as the Tab control i.e. they
are referenced by their names, not as sub-controls of the Tab control. For example
to set the Text property of a TextBox placed on the Tab control code:
Container PageCaption
Methods: Move Refresh SetFocus ZOrder
Events: BeforeClick KeyDown LostFocus MouseUp
Click KeyPress MouseDown
GotFocus KeyUp MouseMove
Class ProgID Fujitsu.PcobTabControl.4
name:
Corresponding None
Control in
PowerCOBOL
V3.0 or earlier:
78 Chapter 3. Controls
Table Control
Description: The Table control presents data for display and editing in a table.
Sample image:
Details: The data of individual cells is handled in TableCell objects. You can access these
using the TableCells property.
For example to set a cell in the second row of the third column to "ABC":
MOVE "ABC" TO "Text" OF "TableCells" (2 3)
OF TABLE1
The properties of each column are handled in TableColumn objects. You can access
these using the TableColumns property.
For example to set the width of the third column to 500 units:
MOVE 500 TO "Width" OF "TableColumns" (3)
OF Table1
Editing the You can use the following key strokes when editing the TableColums list in the
TableColumns list: Columns property page of the Table control:
[Alt + Up Arrow] : Move the selected elements upward.
[Alt + Down Arrow] : Move the selected elements downward.
Input: You can control which columns can be edited by setting the Writable property to
True or False at execution time.
Data can be entered to writable table cells when:
• The AutoEdit property of the TableColumn object is set to True and the cell
gains focus.
• The cell has focus and a character key is pressed.
• The cell has focus and the ENTER key is pressed.
• The cell has focus and a double click is executed over the cell.
Data entry is concluded when:
• The ENTER key is pressed.
• The focus is lost by using one of the direction keys.
• The DecisionMaxString property is True and the input data reaches the effective
maximum string length.
Chapter 3. Controls 79
TextBox Control
Description: The TextBox control provides text entry and editing functions.
It offers single and multiple line entry and formatting of entered character strings.
Sample images:
TextBox:
Multi-line TextBox:
Details: The RenderText property enables formatting of the text using COBOL PICTURE string
or date formats.
You can input the text string into an "edit window" by setting the EditableLabel
property to True.
Data can be entered when:
• The AutoEdit property (which can be set in the EditableLabel group of the
SingleLine property page) is True and the TextBox receives focus.
• A character key is pressed.
• The ENTER key is pressed.
• A doubleclick is executed over the TextBox control.
Data entry is concluded when:
• The ENTER key is pressed.
• The focus is lost and moved to another control.
• The DecisionMaxString property (which can be set in the EditableLabel group of
the SingleLine property page) is True and the input data reaches the effective
maximum string length.
• The EditableLabel property is True and you are entering text strings to the "edit
window", the "edit window" disappears when you press the ESC key.
Chapter 3. Controls 81
Timer Control
Description: The Timer control receives events that are generated at the interval specified in the
Interval property. Use it to control functions that must take place at preset time
intervals.
Sample image:
Events: Timer
Toolbar Control
Description: The Toolbar control can have single or multiple buttons.
Other controls can also be placed on the Toolbar control.
Sample image:
However, other controls placed on toolbars are not referred to as part of the toolbar.
For example, if the StaticText control whose name is "CmStatic1" is on the Toolbar
control and you want to set its Caption property to "ABC", code:
MOVE "ABC" TO "Caption" OF CmStatic1
For each button that has an image, set the ImageIndex property to the index of the
image within the image list containing the button images.
Image Lists: The images for the toolbar buttons are held in image list files. The normal, enabled
image is held in the file defined in the ImageList property. The disabled image is held
in the file defined in the DisabledImageList property. If you want a different image
when the mouse pointer is over the button (the typical behavior when you are using
flat toolbar buttons) then you put those images in the file defined in the
HotImageList property.
The general size of toolbar button bitmaps is 16x15 pixels. Therefore the width of
the image list(s) should be a multiple of 16 and the height should be 15. For this
type of image, set the ImageWidth of the image list (that you add to the module) to
16.
If the Align property is set to "3 - Left" or "4 - Right", the height of the control (the
value of Height property) is the same as the value of the ClientHeight property of the
Form object. Otherwise, the height of the control is set automatically depending on
the size of the image list and Caption property of the Button objects on the Toolbar
control. This means that you are not able to set the height of the control.
If the DisabledImageList or HotImageList property is not set, PowerCOBOL uses the
image list defined in the ImageList property when the button is disabled or "hot".
The values of the ImageWidth property for the ImageList , DisabledImageList and
HotImageList properties should be the same.
84 Chapter 3. Controls
TreeView Control
Description: The TreeView control is a special list box that enables hierarchical relationships to be
displayed.
Sample image:
A TreeView control
Details Each item in the hierarchy is defined using a Node object. First define root Node
objects, then define child Node objects which can have their own children.
For example to refer to the text string of the third child node defined in the second
root node:
MOVE "Text" OF "Child" (3) OF Root (2) OF
TreeView1 TO ...
Properties: Appearance Font Name TabIndex
Array Height Parent TabStop
BorderStyle HideSelection PathSeparator ToolTipText
ClassMajorVersion ImageList Root Top
ClassMinorVersion IMEMode ScaleMode TotalCount
ClassProgID Indentation ScalingStyle TVLineStyle
Container Index SelNode TVStyle
Count LabelEdit Sorted Visible
Enabled Left TabGroup Width
Methods: Add Insert Refresh StartEdit
Clear Move SetFocus ZOrder
Delete
Events: Click Expand KeyUp MouseUp
Collapse GotFocus LostFocus NodeClick
DblClick KeyDown MouseDown Return
Edit KeyPress MouseMove
Class ProgID Fujitsu.PcobTreeView.4
name:
Corresponding None
Control in
PowerCOBOL
V3.0 or earlier:
86 Chapter 3. Controls
Chapter 4. Properties
This chapter describes all the PowerCOBOL properties.
Used in control(s): Lists the controls or objects that have the property.
Values (with constants): Lists and describes the possible values for the property.
Where relevant, the PowerCOBOL constants that can be used for the values
are provided in parentheses beside the applicable value. For example for
the AccessMode property:
This means you can use POW-DB-READWRITE instead of the numeric literal
0 in your code:
IF "AccessMode" OF CmDb1
= POW-DB-READWRITE ...
COBOL picture: Provides the COBOL picture description for the property.
OLE data type: Gives the OLE data type of the property.
Design time access: Whether the property can be set and/or referenced at design time.
Execution time access: Whether the property can be set and/or referenced at execution time.
Backward compatibility The equivalent attributes (if any) from earlier releases of PowerCOBOL. Use
attributes: the "Property name" rather than these attribute names when creating new
applications.
88 Chapter 4. Properties
Editing Properties
You edit properties by using either the Properties dialog in the Edit Form window or
the Property Value list in the PowerCOBOL Project Manager window.
Properties that can only be set at execution time and ones whose OLE data types are
VT_DISPATCH are not displayed in the Property Value list.
"Property-name" OF Control-name
For example to change the Caption property of the static text control "StaticText1" to
the value in data item WORK-1 you code:
AccessMode Property
Description: Determines whether or not the database can be updated.
Active Property
Description: Controls whether the timer starts or stops.
ActiveControl Property
Description: Contains a pointer to the control that has the focus.
Used in controls: None.
Used in objects: Form
Value: A pointer to the control, which has focus on the form.
If no control has focus the value is NULL. Use the constant POW-NULL to
check if the value is set.
The value can be accessed using the NetCOBOL *COM class.
Note: it cannot be accessed like other properties. See the Example of Using
the ActiveControl Property on the next page.
Default value: None.
COBOL PICTURE: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attributes:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 COM-FORM OBJECT REFERENCE COM.
01 COM-ACT-CTL OBJECT REFERENCE COM.
01 CTL-NAME PIC X(14).
PROCEDURE DIVISION.
* OBJECT REFERENCE POW-COBJECT is compared with POW-NULL.
IF "ActiveControl" OF POW-SELF = POW-NULL THEN
DISPLAY "No control has the focus."
EXIT PROGRAM
ELSE
CALL "POWERCONVTOCOM" USING POW-SELF
RETURNING COM-FORM
INVOKE COM-FORM "GET-ACTIVECONTROL"
RETURNING COM-ACT-CTL
* OBJECT REFERENCE COM is compared with NULL object.
IF COM-ACT-CTL NOT = NULL THEN
INVOKE COM-ACT-CTL "GET-NAME" RETURNING CTL-NAME
DISPLAY CTL-NAME " has the focus."
SET COM-ACT-CTL TO NULL
ELSE
DISPLAY "Error"
END-IF
SET COM-FORM TO NULL
END-IF
Chapter 4. Properties 91
Align Property
Description: Indicates the alignment of the control within the container.
Default value:
Toolbar 1 - Top (POW-ALIGNTOP)
Custom 0 - None (POW-ALIGNNONE)
Alignment Property
Description: Gives the alignment of the character string(s), specified in the Caption
property, within the control or object.
Used in:
Controls CheckBox Label StaticText TextBox
Frame OptionButton
Objects Column TableColumn
Values (with constants):
CheckBox and OptionButton 0 - Left (POW-CAPTIONALIGNMENT-LEFT)
1 - Right (POW-CAPTIONALIGNMENT-RIGHT)
TextBox and Column 0 - Left (POW-TEXTALIGNMENT-LEFT)
1 - Center (POW-TEXTALIGNMENT-CENTER)
2 - Right (POW-TEXTALIGNMENT-RIGHT)
For the TextBox control, it is only effective when the EditableLabel property
is True and the MultiLine property is False.
When the text is being edited the alignment is left justified regardless of the
value of the Alignment property.
Frame 1 - Top/HCenter (POW-ALIGNMENT-TOPHCENTER)
2 - Top/Right (POW-ALIGNMENT-TOPRIGHT)
4 - VCenter/Left (POW-ALIGNMENT-VCENTERLEFT)
5 - VCenter/HCenter (POW-ALIGNMENT-VCENTERHCENTER)
6 - VCenter/Right (POW-ALIGNMENT-VCENTERRIGHT)
8 - Bottom/Left (POW-ALIGNMENT-BOTTOMLEFT)
9 - Bottom/HCenter (POW-ALIGNMENT-BOTTOMHCENTER)
10 - Bottom/Right (POW-ALIGNMENT-BOTTOMRIGHT)
99 - Auto (POW-ALIGNMENT-AUTO)
Note that:
If the FrameStyle property is "0 - GroupBox",
the values 0, 4 or 8 are Top/Left,
the values 1, 5 or 9 are Top/HCenter,
the values 2, 6 or 10 are Top/Right.
If the value is "99 - Auto" and the FrameStyle property is
"0 - GroupBox" the alignment becomes Top/Left.
If the value is "99 - Auto" and the FrameStyle property is
"1 - Panel", the alignment becomes VCenter/HCenter.
Chapter 4. Properties 93
Backward compatibility
attribute:
For CheckBox, POW-TEXTPOS PIC S9(4) COMP-5
OptionButton, and
StaticText
94 Chapter 4. Properties
Appearance Property
Description: Indicates whether the object or control has a flat or 3D appearance.
Used in:
Controls Animation Graph MCI StaticText
Edit GroupBox ProgressIndicator Table
FileList Image Shape TextBox
FolderList ListBox Slider TreeView
Frame ListView
Object Form
Values (with constants): 0 - Flat (POW-APPEARANCE-FLAT)
1 - 3D (POW-APPEARANCE-3D)
Specific Details:
Form Makes the border to the client area 3D or flat.
Frame It is not effective when the FrameStyle is "1-Panel" and the BorderStyle is
"0-None".
Shape It is only effective when:
ShapeStyle property is "0-Rectangle" or "1 - Square"
and
BorderStyle property is "1 - Solid" or "6-InsideFrame"
and
BorderRound property is 0.
Others It is only effective when BorderStyle property is "1 - Solid".
Default values:
Form and Shape 0 - Flat (POW-APPEARANCE-FLAT)
Others 1 - 3D (POW-APPEARANCE-3D)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 95
Archive Property
Description: Determines whether the list box shows files with the archive attribute set.
Arrange Property
Description: Defines the position of icons in the ListView control, small and large icon
modes.
Used in control(s): ListView
Values (with constants): 0 - None: (POW-LVICON-AUTO)
Arranges the items automatically.
1 - Left: (POW-LVICON-LEFT)
Arranges the items from top to bottom, left to right.
2 - Top: (POW-LVICON-TOP)
Arranges the items from left to right, top to bottom.
It is only effective when the LVStyle property is "0 - Large icon" or "1 -
Small icon".
Default value: 0 - None: (POW-LVICON-AUTO)
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
96 Chapter 4. Properties
Array property
Description: Indicates whether or not the control is part of an array.
Used in control(s): All controls except the GroupBox control.
Values (with constants): True: The control is part of an array. (POW-TRUE)
False: The control is not part of an array. (POW-FALSE)
Default value: False: (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
AutoChange Property
Description: Determines whether double click makes the double-clicked folder the
current folder.
Used in control(s): FolderList
Values (with constants): True - Makes the folder the current folder. (POW-TRUE)
False - Does not make the folder the current folder. (POW-FALSE)
If you set the property to True and double-click a folder, the current folder
is changed but the change is not notified to other controls. Therefore you
need to add code like that shown below in the Change event or other
events.
For example in the FolderControlName-Change event:
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
PATH PIC X(260).
PROCEDURE DIVISION.
MOVE "Path" OF FolderControlName
TO PATH
MOVE PATH
TO "Path" OF FileControlName
AutoEdit Property
Description: Determines whether the TextBox control or cells are put into edit mode as
soon as they receive the focus.
Used in controls: TextBox
Used in object: TableColumn
Values (with constants): True: Cells are put into edit mode when they receive the focus.
(POW-TRUE)
False: Cells do not enter edit mode whey they receive the focus.
(POW-FALSE)
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
AutoHScroll Property
Description: Indicates whether text scrolls horizontally or wraps to the next line in a
TextBox.
Used in control(s): TextBox
Values (with constants): True – Text scrolls horizontally automatically. When the text reaches the
end of the textbox a scroll bar is displayed and input continues on
the same line. (POW-TRUE)
False – Text wraps to the next line. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
98 Chapter 4. Properties
AutoLoadFile Property
Description: Indicates whether to load the new file automatically when either the
FileType or RecordForm property is changed.
Used in control(s): ComboBox
Values (with constants): True - Loads the file automatically. (POW-TRUE)
False - Does not load the file automatically. (POW-FALSE)
If it is False the control only loads the file when the FileName property is
set.
Note that, if the AutoLoadFile property is set to False you cannot change
the field when the CurFieldNo property is changed.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
AutoOpen Property
Description: Determines whether to open the device automatically at execution time.
AutoPlay Property
Description: Indicates whether the animation or media is started automatically.
AutoRowHeight Property
Description: Indicates whether the height is adjusted automatically according to the font
size, or if the value specified in the DefaultRowHeight property is used.
Used in control(s): Table
Values (with constants): True - The height is adjusted automatically. (POW-TRUE)
False - The DefaultRowHeight value is used. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
100 Chapter 4. Properties
AutoSize Property
Description: Indicates whether the length of the list box should be determined by the
number of items to be listed.
Used in control(s): ComboBox DriveList
Values (with constants): True: The length is set automatically. (POW-TRUE)
False: The length of the list is set at design time. (POW-FALSE)
AutoTick Property
Description: Indicates whether graduation marks ("ticks") are displayed at intervals
determined by the TickFrequency property.
Used in control(s): Slider
Values (with constants): True: Slider displays ticks. (POW-TRUE)
False: Does not display ticks. (POW-FALSE)
Note: You can add ticks using the AddTick method only when the AutoTick
property is False.
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 101
BackColor Property
Description: Defines the background color of the control or object.
Used in:
Control(s) Animation FileList Label ScrollBar
CheckBox FolderList ListBox Shape
ComboBox Frame ListView StaticText
CommandButton Graph MCI Table
DriveList GroupBox OptionButton TextBox
Edit Image ProgressIndicator Toolbar
Objects Form TableCell
Values: Refer to "Appendix A, Color Constants" and OLE_COLOR described in
"Appendix C, Data Types" for details of color values.
It is only effective when the Hilight property is True.
TableCell If the BackColor property is set to a different value from the Table control's
BackColor property, the cell is painted in the value of the TableCell object's
BackColor property.
If the BackColor property is set to the same value as the Table control's
BackColor property, the cell's BackColor property is initialized and painted in
the value of the Table control 's BackColor property.
Table Column header cells are only painted when the Appearance property is "0-
Flat" and the CaptionBackGray property is False.
If the BackColor property of a TableCell object is set, the cell is not painted
with the Table control's BackColor but uses the TableCell object's BackColor.
Toolbar It is only effective when the UseSystemColor property is False.
When the Style property is "1-Flat" or "2-FlatList", buttons on the Toolbar
Control take on a transparent style and their backcolor becomes the
Toolbar's backcolor.
Default value:
Form System's Window Background color
TableCell Table control's BackColor property.
Others Container's BackColor property
COBOL picture: S9(9) COMP-5
OLE data type: OLE_COLOR
Design time access:
TableCell Not accessible.
Others Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-BACKCOLOR PIC X(4)
attribute:
102 Chapter 4. Properties
BackStyle Property
Description: Indicates whether the background is visible through the control.
Used in control(s): Animation Label StaticText TextBox
Graph MCI Table
Image Shape
Values (with constants): 0 - Transparent (POW-BACKSTYLE-TRANSPARENT)
1 - Opaque (POW-BACKSTYLE-OPAQUE)
Shape Additional value:
2 - Half transparent (POW-BACKSTYLE-TRANSLUCENT)
TextBox It is only effective when the EditableLabel property is True and the MultiLine
property is False.
Default value:
Shape 0 - Transparent (POW-BACKSTYLE-TRANSPARENT)
Others 1 - Opaque (POW-BACKSTYLE-OPAQUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
For the StaticText POW-TRANSPARENT PIC S9(4) COMP-5
BlankSuppress Property
Description: Determines whether blanks are suppressed in strings derived from the
COBOL-PICTURE string.
Used in object: RenderText
Values (with constants): True - Blanks are suppressed. (POW-TRUE)
False - String is taken as is, including blanks. (POW-FALSE)
It is only effective when the RenderStyle property is "1 - COBOL-PICTURE".
Blanks affected:
Figure and Edited Numeric Leading blank(s)
Alphabet, Alphanumeric Trailing blank(s)
Character and
Alphanumeric Edited
Japanese and Japanese Trailing em-size blank(s).
Edit
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 103
Bold Property
Description: Determines whether the style of the font is a boldface type.
Used in object: Font
Values (with constants): True - Bold. (POW-TRUE)
False - Not bold. (POW-FALSE)
BookName Property
Description: Contains the Excel book name.
Used in control(s): ExcelConnection
Value: The Excel book name.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-SHEETNAME PIC X(260)
attribute:
BorderColor Property
Description: Determines the color of the borderline.
Used in control(s): Shape
Value: Color for border line.
Refer to "Appendix A, Color Constants" and OLE_COLOR described in
"Appendix C, Data Types" for details of color values.
It is only effective when the Appearance property is "0-Flat".
Default value: System's Window Text color.
COBOL picture: S9(9) COMP-5
OLE data type: OLE_COLOR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
104 Chapter 4. Properties
BorderRound Property
Description: Defines the extent of corner rounding for the border.
Used in control(s): Shape
StaticText
Value: 0 to 100
A value of 0 gives sharp, rectangular corners.
A value of 100 makes the border into a circle or oval.
It is only effective when the ShapeStyle property is "0-Rectangular" or "1 -
Square".
Note that if the value of the BorderRound property is not zero and the value
of Appearance property is "1 - 3D", the Appearance property is ignored.
Default value: 0 - No rounding.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
For StaticText POW-ROUND PIC S9(4) COMP-5
Chapter 4. Properties 105
BorderStyle Property
Description: Determines the style of the frame.
Used in:
Controls Animation Graph MCI Table
Edit GroupBox ProgressIndicator TextBox
FileList Image Shape TreeView
FolderList ListBox Slider
Frame ListView StaticText
Object Form
Values (with constants):
Form 0 - Variable (POW-BORDER-VARIABLE)
1 - Fixed (POW-BORDER-FIXED)
2 - Dialog Frame (POW-BORDER-DIALOG)
3 - Variable Tool (POW-BORDER-VARIABLETOOL)
4 - Fixed Tool (POW-BORDER-FIXEDTOOL)
5 - No Frame (POW-BORDER-NOFRAME)
Shape 0 - None (POW-BORDER-NONE)
1 - Solid (POW-BORDER-SOLID)
2 - Dash (POW-BORDER-DASH)
3 - Dot (POW-BORDER-DOT)
4 - Dash dot (POW-BORDER-DASHDOT)
5 - Dash double dot (POW-BORDER-DASHDOTDOT)
6 - Inside frame - a solid line within the frame
(POW-BORDER-INSIDEFRAME)
If the value of the BorderWidth property is over 1 pixel and the value of the
BorderStyle property is 2 to 5, the value of the BorderStyle property is
ignored and the frame is solid.
Others 0 - Off (None) (POW-BORDER-NONE)
1 - Solid (POW-BORDER-SOLID)
Default values:
Form 0 - Variable (POW-BORDER-VARIABLE)
StaticText and Slider 0 - Off (None) (POW-BORDER-NONE)
Others 1 - Solid (POW-BORDER-SOLID)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access:
Form Not accessible
Controls Set and reference.
Backward compatibility
attribute:
For Image, Shape, POW-BORDER PIC S9(4) COMP-5
StaticText and TextBox
106 Chapter 4. Properties
BorderWidth Property
Description: Defines the thickness of the borderline.
Used in control(s): Shape
Value: Width of the border in the units specified in the ScaleMode property.
This value should be less than half the size of the Width and Height
properties.
If the specified width is equivalent to 2 pixels or more, PowerCOBOL uses a
solid line for the border, overriding the BorderStyle property.
Default value: 1 pixel.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
BottomMargin Property
Description: Defines the depth of the margin at the bottom of the page when the form is
printed.
Used in control(s): Print
Value: The margin depth in the units defined in the PaperScaleUnit property.
Default value: 0.6 inch
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-BOTTOMMARGIN PIC S9(9) COMP-5
attribute:
Chapter 4. Properties 107
Buttons Property
Description: Contains a pointer to a Button object of the Toolbar control. The pointers
are contained in an array, so always use an index when referencing the
Buttons property.
Used in control(s): Toolbar
Value: A pointer to a Button object
The index can be set from 1 to the value of the Count property.
For example to refer to the Caption property of button 5 of the Toolbar1
control, you code:
Cancel Property
Description: Indicates whether the control is the default cancel button (i.e. the button
activated by the ESC key).
Used in control(s): CommandButton Custom
Values (with constants): True - This is the default cancel button. (POW-TRUE)
False - Not the default cancel button. (POW-FALSE)
When it is True, the Click event is generated when the ESC key is pressed.
The focus, however, does not move.
Only one control in a form can be the default cancel button. When the
Cancel property is set to True for a control, PowerCOBOL sets the Cancel
properties of all other controls to False.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
108 Chapter 4. Properties
Caption Property
Description: Contains the label or title string for the control or object.
Used in:
Controls CheckBox Frame Label StaticText
CommandButton GroupBox OptionButton Tab
Objects Button Form MenuItem
Values:
Form The title string for the form.
Button The label string for a button on the Toolbar control. The string is displayed
below or to the right of the button.
Although you can use "&" to indicate that the following character is
underlined, it has no effect as an access key.
Tab The title string of the currently selected tab page.
You can use "&" to indicate that the following character should be
underlined as a mnemonic (access key).
Use "&&" to include the "&" character in the string.
Others The label or title string for the control or object.
You can use "&" to indicate that the following character should be
underlined as a mnemonic (access key).
Use "&&" to include the "&" character in the string.
If the RenderStyle property is set, you can only set the Caption property to
a string that conforms to the RenderStyle property.
Default value:
Tab None.
Others Same as the Name property
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attributes:
For the StaticText POW-TEXT PIC X(256)
POW-DATE PIC X(8)
Tab and Toolbar None.
For all other POW-TEXT PIC X(256)
Chapter 4. Properties 109
CaptionBackGray Property
Description: Determines whether the row and column headings have a background color
of Gray or the color defined in the BackColor property.
Used in control(s): Table
Values (with constants): True - Gray background. (POW-TRUE)
False - Same as BackColor property. (POW-FALSE)
It is only effective when the Appearance property is "0-Flat".
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
CellLines Property
Description: Determines whether cell borderlines are displayed.
Used in control(s): Table
Values (with constants): True: Display cell borderlines. (POW-TRUE)
False: Does not display cell borderlines. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
110 Chapter 4. Properties
Charset Property
Description: Contains the character setting for the font.
Used in object: Font
Values (with constants): 0 - Western (POW-FONTCHARSET-ANSI)
Windows standard character setting.
2 - Symbol (POW-FONTCHARSET-SYMBOL)
Special character setting. (Symbol)
255 - System dependent (POW-FONTCHARSET-OEM)
OEM character setting
The value depends on the font.
There are fonts that have other character settings.
Default value: Depends on the containing control.
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Check Property
Description: Indicates whether a check mark is displayed to the left of the menu item.
Used in object: MenuItem .
Values (with constants): True: Displays a check mark. (POW-TRUE)
False: Does not display a check mark. (POW-FALSE)
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-CHECK PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 111
CHVisible Property
Description: Determines whether headings of Column objects are displayed when the
LVStyle property is "3 - Report".
Used in control(s): ListView
Values (with constants): True - Displays headings. (POW-TRUE)
False - Does not display headings. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
112 Chapter 4. Properties
ClassMajorVersion Property
Description: Indicates the major version of each control.
Used in controls: All controls.
Value: The number of major version for the control.
Default value: None.
COBOL PICTURE: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attributes:
ClassMinorVersion Property
Description: Indicates the minor version of each control.
Used in controls: All controls.
Value: The number of minor version for the control.
Default value: None.
COBOL PICTURE: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attributes:
ClassProgID Property
Description: Indicates the ProgID name of each control.
Used in controls: All controls.
Used in objects: None.
Value: The name of the ProgID indicating class.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attributes:
Chapter 4. Properties 113
ClickColumn Property
Description: Contains the column number in which the mouse is clicked.
Used in control(s): Table
Value: The column number in which the mouse was clicked.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-CLICKCOL PIC S9(4) COMP-5
attribute:
ClickRow Property
Description: Contains the row in which the mouse is clicked.
Used in control(s): Table
Value: The row number in which the mouse was clicked.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-CLICKROW PIC S9(4) COMP-5
attribute:
ClientHeight Property
Description: Defines the height of the client area.
Used in control(s): Form object Tab
Value: The height of the client area expressed in the units defined in the
ScaleMode property.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access:
Form Set and reference.
Tab Not accessible.
Execution time access:
Form Set and reference.
Tab Reference only.
Backward compatibility None.
attribute:
114 Chapter 4. Properties
ClientLeft Property
Description: Defines the X coordinate of the tab client area.
Used in control: Tab
Value: The X coordinate of the client area – relative to the top left corner of the
container - expressed in the units defined in the ScaleMode property.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
ClientTop Property
Description: Contains the Y coordinate of the client area.
Used in control: Tab
Value: Contains the Y coordinate of the client area – relative to the top left corner
of the container - expressed in the units determined by the ScaleMode
property.
Default value: None.
COBOL picture S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
ClientWidth Property
Description: Contains the width of the client area.
Used in control(s): Form object Tab
Value: The width of the client area in the units defined in the ScaleMode property.
Default value: None.
COBOL picture S9(9) COMP-5
OLE data type: VT_I4
Design time access:
Form Set and reference.
Tab Not accessible.
Execution time access:
Form Set and reference.
Tab Reference only.
Backward compatibility attribute: None.
Chapter 4. Properties 115
ColorMap Property
Description: Defines the color mapping for the image.
Used in control(s): CommandButton
Values (with constants): 0 - No: (POW-COLORMAP-NO)
No color mapping.
1 - Back: (POW-COLORMAP-BACK)
Only maps the background using the color specified in Mapped Face
Color in the ImageImage_CommandButton_page property page.
2 - All: (POW-COLORMAP-ALL)
Maps Black to the Button Text color,
Light Gray to the Button Face color,
White to the Button Highlight color and
Gray to the Button Shadow color.
The image is mapped only when the ColorMap property is "1 - Back" or "2 -
All" regardless of the value of the UseSystemColor property.
PowerCOBOL maps the color of the ForeColor property to the Button Text
color, and the color of the BackColor to the Button Background color if the
UseSystemColor property is False. The system color always maps to the
Button Highlight color and Shadow color.
Default value: 0 - No: (POW-COLORMAP-NO)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
Column Property
Description: Contains the column number of the cell that has the focus.
Used in control(s): Table
Value: The column number of the cell that has the focus.
Only cells in which the Writable property of the TableColumn object is True
can get the focus.
Default value: The column number of the leftmost cell in which the Writable property of
the TableColumn object is True.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility POW-COL PIC S9(9) COMP-5
attribute:
116 Chapter 4. Properties
ColumnCaption Property
Description: Determines whether to display column headings.
Used in control(s): Table
Values (with constants): True - Displays the column headings. (POW-TRUE)
False - Does not display the column headings. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-COLCAPTION PIC S9(4) COMP-5
attribute:
ColumnCount Property
Description: Contains the number of columns in the control.
Used in control(s): ListView Table
Value: The number of columns in the control.
For the Table control, the maximum number is 255.
Default value:
ListView 0
Table 2
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access:
ListView Set and reference.
Table Set and reference.
Execution time access:
ListView Reference only.
Table Set and reference.
Backward compatibility
attribute:
Table POW-COLS PIC S9(4) COMP-5
Chapter 4. Properties 117
Command Property
Description: Contains a command string to be passed to the MCI driver.
Consult the MCI driver documentation for details.
Used in control(s): MCI
Value: A command string to be passed to the MCI driver.
The return information is placed in the Receive property.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility POW-MCISTRING PIC X(256)
attribute:
118 Chapter 4. Properties
CommandButtonFunctionKeyMode Property
Description: Determines whether to set focus to the CommandButton control when the
assigned function key is pressed.
Used in controls: None.
Used in objects: Form
Value (with constants): 0 : Normal (POW-FUNCTIONKEYMODE-NORMAL)
1 : Set focus to CommandButton control
(POW-FUNCTIONKEYMODE-FOCUS)
Default value: 0 : Normal (POW-FUNCTIONKEYMODE-NORMAL)
Note : For projects created using V4.0L10 the default value is 1.
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
CommandLine Property
Description: Contains the command line parameters passed to the application.
It is only effective when the form is contained in a module that makes an
EXE file.
Used in object: Form
Value: The string of command line parameters specified when the application was
started.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-COMMANDLINE PIC X(260)
attribute:
Chapter 4. Properties 119
CommandText Property
Description: Contains the text of the command to open the record set.
Used in controls: ADODataSource
Value: Command text string to open the record set.
Consult the ADO documentation for details about command text.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
CommandType Property
Description: Indicates the type of text specified in the CommandText property.
Used in controls: ADODataSource
Values (with constants): 1 - adCmdText: (POW-ADODB-ADCMDTEXT)
SQL statement.
2 - adCmdTable: (POW-ADODB-ADCMDTABLE)
Table name returned from SQL query, in which columns are created.
4 - adCmdStoredProc: (POW-ADODB-ADCMDSTOREDPROC)
Stored procedure.
8 - adCmdUnknown: (POW-ADODB-ADCMDUNKNOWN)
Distinguish automatically, when the command type is unknown.
Consult the ADO documentation for details about command types.
Default value: 8 - adCmdUnknown: (POW-ADODB-ADCMDUNKNOWN)
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
120 Chapter 4. Properties
CommitMode Property
Description: Indicates the commit mode for data base updates.
Used in control(s): DBAccess
Values (with constants): 0 - Automatic (POW-DBCOMMIT-AUTO)
1 - Manual (POW-DBCOMMIT-MANUAL)
Default value: 0 - Automatic (POW-DBCOMMIT-AUTO)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility POW-DBMANUALCOMMIT PIC S9(4) COMP-5
attribute:
ConcurrencyCursor Property
Description: Indicates the cursor mode for concurrent updates.
It is only effective when the target is a table.
Used in control(s): DBAccess
Values (with constants): 1 - SQL_CONCUR_READ_ONLY: (POW-DBCONCUR-READONLY)
No updates are permitted using the cursor.
2 - SQL_CONCUR_LOCK: (POW-DBCONCUR-LOCK)
The cursor locks the row for update.
3 - SQL_CONCUR_OPT_ROWVER: (POW-DBCONCUR-OPTROWVER)
Row versions are compared before update using the optimization
concurrent control.
4 - SQL_CONCUR_OPT_VALUES: (POW-DBCONCUR-OPTVALUES)
Values are compared before update using the optimization concurrent
control.
The current record can be updated or deleted unless ConcurrencyCursor is
set to 1.
Default value: 1 - SQL_CONCUR_READ_ONLY: (POW-DBCONCUR-READONLY)
No updates are permitted using the cursor.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 121
Condition Property
Description: Defines the extraction condition for the SelectRecords method.
Used in control(s): DBAccess
Value: A string defining the condition to be used in the SelectRecords method.
The string must conform to the supported ODBC syntax.
It is only effective when the TargetType property is "0-Table/View".
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DBCONDITION PIC X(512)
attribute:
Connection Property
Description: Contains a pointer to the ADO connection object.
Used in controls: ADODataSource
Value: A pointer to the ADO connection object.
Consult the ADO documentation for details about connection objects.
Notes The following properties of the ADODataSource control can not be set if the
ADO connection object is created dynamically and set to this property.
ConnectionString
ConnectionTimeout
ConnectMode
And, you must open the connection by using the Open method of the ADO
connection object if the connection is not opened.
Consult the ADO documentation for details about connection object.
Default value: None.
COBOL PICTURE: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
122 Chapter 4. Properties
ConnectionString Property
Description: Contains the string to use to connect to a database.
Used in controls: ADODataSource DBAccess
Value: The string to connect to a database.
ADODataSource Consult the ADO documentation for details about connection strings.
DBAccess Consult the ODBC documentation for details about connection strings.
It is only effective when connected to a common file database.
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ConnectionTimeout Property
Description: Indicates how long to wait while establishing a connection before
terminating the attempt and generating an error.
Used in controls: ADODataSource
Value: The time, in seconds, of how long to wait for the connection to open.
Consult the ADO documentation for details about connection timeout.
Default value: 15 seconds
COBOL PICTURE: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
Chapter 4. Properties 123
ConnectMode Property
Description: Indicates the available permissions for modifying data in a Connection.
Used in controls: ADODataSource
Used in Objects: None.
Values (with constants): 0 - adModeUnknown: (POW-ADODB-ADMODEUNKNOWN)
Mode is unknown or the permissions have not yet been set or cannot be
determined.
1 - adModeRead: (POW-ADODB-ADMODEREAD)
Read-only permissions.
2 - adModeWrite: (POW-ADODB-ADMODEWRITE)
Write-only permissions.
3 - adModeReadWrite: (POW-ADODB-ADMODEREADWRITE)
Read/write permissions.
4 - adModeShareDenyRead: (POW-ADODB-ADMODESHAREDENYREAD)
Prevents others from opening a connection with read permissions.
8 - adModeShareDenyWrite: (POW-ADODB-ADMODESHAREDENYWRITE)
Prevents others from opening a connection with write permissions.
12 - adModeShareExclusive: (POW-ADODB-ADMODESHAREEXCLUSIVE)
Prevents others from opening a connection.
16 - adModeShareDenyNone: (POW-ADODB-ADMODESHAREDENYNONE)
Allows others to open a connection with any permissions. Neither read
nor write access can be denied to others.
Consult the ADO documentation for details about connect mode.
Default value: 0 - adModeUnknown: (POW-ADODB-ADMODEUNKNOWN)
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
124 Chapter 4. Properties
Container Property
Description: Contains a pointer to the container object.
Used in controls: All controls.
Value: A pointer to the Form object if the control is pasted on the Form object
directly.
In the other cases, it's a pointer to the container control, which can paste
controls on it.
The container controls are GroupBox control, Frame control, Tab control and
Toolbar control.
Default value: None.
COBOL PICTURE: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attributes:
ControlBox Property
Description: Determines whether the title bar contains the application icon (control box
at the top-left of the form).
Used in object: Form
Values (with constants): True - Includes the control box (POW-TRUE)
False - Does not include the control box (POW-FALSE)
When it is True, the title bar includes the close, resize, minimize and
maximize buttons depending on the form style.
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None
attribute:
Chapter 4. Properties 125
Controls Property
Description: Contains a pointer to the Controls collection object of the Form object.
Used in object: Form
Value: A pointer to the Controls collection object.
Default value: None.
COBOL PICTURE: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attributes:
Count Property
Description: Indicates the number of objects in the control or object.
Used in:
Controls ListView Toolbar TreeView
Objects Controls DataBindings Node
Values:
Controls The number of controls contained in the Form object.
DataBindings The number of DataBinding objects contained in a Custom control that can
bind data.
ListView The number of ListItem objects contained in the control.
Toolbar The number of Button objects contained in the control.
TreeView, Node The number of child nodes immediately under the control or object.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
126 Chapter 4. Properties
CurFieldNo Property
Description: Contains the number of the field displayed in the list box.
Only valid when data is loaded from CSV or Fixed Text format files.
Used in control(s): ComboBox
Value: The number of the field to be displayed.
Records from CSV or Fixed Text format files can contain several fields. The
ComboBox control displays the values from only one of these fields at a
time.
It is only effective when the AutoLoadFile property is True.
Default value: 1
Data type: VT_14
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-CURFIELDNO PIC S9(4) COMP-5
attribute:
CurrencySign Property
Description: Contains the currency edit character used by the PictureString property.
Used in object: RenderText
Value: The currency edit character - $, \ etc.
It is only effective when the RenderStyle property is "1 - COBOL PICTURE".
Default value: Depends on the system.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 127
CurrentPage Property
Description: Contains the page number of the currently selected page.
Used in control: Tab
Value: The page number of the currently selected page.
The CurrentPage property can be from 1 to the value of the PageCount
property
Default value: 1
COBOL picture S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
CursorLocation Property
Description: Indicates the location of the cursor service.
Used in controls: ADODataSource
Used in Objects: None.
Values (with constants): 2 - adUserServer: Uses server-side cursors. (POW-ADODB-ADUSERSERVER)
3 - adUserClient: Uses client-side cursors. (POW-ADODB-ADUSERCLIENT)
Consult the ADO documentation for details about cursor locations.
Note: The value may be ignored depending on the kind of OLE DB Provider
to which you connected.
Default value: 3 - adUserClient: Uses client-side cursors. (POW-ADODB-ADUSERSERVER)
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
128 Chapter 4. Properties
CursorType Property
Description: Defines the type of cursor to be used.
DataBase Property
Description: Contains the name of the database to be accessed.
Used in control(s): DBAccess
Value: The name of the database.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Reference only.
Execution time access: Set and reference.
Note that, you can set only space only when you use the default data
source of the machine.
Backward compatibility POW-DBDATABASE PIC X(260)
attribute:
DataBindings Property
Description: Contains a pointer to the DataBindings collection object, which collects
DataBinding objects.
Used in controls: Custom
Used in objects: None.
Value: A pointer to the DataBindings collection object.
Default value: None.
COBOL PICTURE: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Reference only.
Execution time access: Reference only.
Backward compatibility None.
attributes:
130 Chapter 4. Properties
DataCount Property
Description: Contains the number of data values in the graph.
Used in control(s): Graph
Value: The number of data values in the graph.
Valid values are in the range 0 to 256.
Default value: 8
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
DataField Property
Description: Contains the name of the data field that will be bound to a property in a
custom control. The data field is contained in the data source object defined
in the DataSource property.
The property in the custom control must be set up for data binding (this is
done by the creators of the custom control).
Used in controls:
Controls: Custom Edit
Object: DataBinding
Value: The name of a data field.
Note that, if the data source contains more than one data set, it is
necessary to specify the DataMember property before you set the DataField
property.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
DataMember Property
Description: Defines the name of the data member that contains a data field to be
bound to a property in a custom control. The data member is contained in
the data source object defined in the DataSource property.
The data member is a text string that identifies a data set in the data
source object.
You do not have to specify a data member if the data source object has
only one data set.
Used in controls:
Controls: Custom Edit
Object: DataBinding
Value: The name of a data member.
Note that, it is necessary to specify the DataMember property before you
set the DataField property.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
132 Chapter 4. Properties
DataSource Property
Description: Contains the name of, or a pointer to, a connected data source.
Used in:
Controls Custom DBAccess Edit
Object DataBinding
Values:
DataBinding and A pointer to the connected data source.object.
Custom Is set to POW-NULL if you release the connection to the data source object.
DBAccess The name of a data source.
Default value: None.
COBOL picture:
DataBinding and OBJECT REFERENCE POW-COBJECT
Custom
DBAccess X, up to 8192 bytes
OLE data type:
DataBinding and VT_DISPATCH
Custom
DBAccess VT_BSTR
Design time access: Set and reference.
Execution time access:
DataBinding and Set and reference.
Custom Note that, to set the value, you should code:
INVOKE control-name "SETREF-DataSource"
USING data-source-object
or
INVOKE control-name "SETREF-DataSource"
USING POW-NULL
DBAccess Reference only.
Backward compatibility
attribute:
DataBinding and None.
Custom
DBAccess POW-DBDATASOURCE PIC X(32)
Chapter 4. Properties 133
DateFormat Property
Description: Defines the date format to be used.
Used in:
Control Print
Object RenderText
Value: The date format is made up of macro strings and other text.
A macro string is one of the following:
yyyy: 4 digit year. (e.g. 1998)
Month: Fully spelt month. (e.g. December)
Mon: Abbreviated month. (e.g. Dec)
MMMM: Fully spelt month. Spelling depends on the system's regional
settings.
MMM: Abbreviated month. The abbreviation depends on the system's
regional settings.
MM: Numeric month. (1 to 12)
dd: Numeric day. (1 to 31)
For example, if the value is specified as "dd , Mon - yyyy", the date text
"19981231" would be displayed or printed:
"31 , Dec - 1998"
The DateFormat property is only effective when the DateStyle property is
"99-Custom".
RenderText The DateStyle property, and hence the DateFormat property, is only
effective when the RenderStyle property is "2 - Date".
The RenderText object converts a character string of the form "yyyyMMdd",
or as defined by the InputFormat property, to the style indicated by the
macro string.
If you specify a format that does not contain all elements of the date,
PowerCOBOL substitutes the value 1 for the missing elements. For example,
if there is no InputFormat set, and you enter "19981231" to a field with the
format value "yyyy-MM", PowerCOBOL displays "1998-12", but the output
value would be "19981201".
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access:
Print Set and reference.
RenderText Reference only.
Backward compatibility None.
attribute:
134 Chapter 4. Properties
DateStyle Property
Description: Indicates the date style to be used.
Used in:
Control Print
Object RenderText
Values (with constants): 0 - Month dd yyyy (POW-DATESTYLE-MONTHDDYYYY)
1 - yyyy/MM/dd (POW-DATESTYLE-YYYYMMDD-SLASH)
2 - yyyy.MM.dd (POW-DATESTYLE-YYYYMMDD-PERIOD)
3 - MM/dd/yyyy (POW-DATESTYLE-MMDDYYYY-SLASH)
4 - MM.dd.yyyy (POW-DATESTYLE-MMDDYYYY-PERIOD)
5 - Mon dd yyyy (POW-DATESTYLE-MONDDYYYY)
99 – Custom (POW-DATESTYLE-CUSTOM)
When the value is 99, you can specify another date style in the DateFormat
property.
RenderText It is only effective when the RenderStyle property is "2 - Date"
The RenderText object converts a character string of the form "yyyyMMdd",
or as defined by the InputFormat property, to the style indicated by the
value.
For example, if there is no InputFormat set, entering "19981231" with the
value 5 (Mon dd yyyy), would display as "Dec 31 1998".
Default value:
Print 5 - Mon dd yyyy (POW-DATESTYLE-MONDDYYYY)
RenderText 0 - Month dd yyyy (POW-DATESTYLE-MONTHDDYYYY)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access:
Print Set and reference.
RenderText Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 135
DDEData Property
Description: Contains the data transferred from the DDE server.
Used in control(s): DDE
Value: The data passed from the DDE server.
The DDEDataLength property contains the length of the data in DDEData.
Use the RequestData method if more than 4096 bytes is to be transferred.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-DDEDATA PIC X(4096)
attribute:
DDEDataLength Property
Description: Contains the length of the data passed from the DDE server.
Used in control(s): DDE
Value: The length of the data passed from the DDE server in the DDEData
property.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-DDEDATALEN PIC S9(9) COMP-5
attribute:
136 Chapter 4. Properties
DDEDataOffset Property
Description: Contains the offset of the data passed in the current method invocation.
Used in control(s): DDE
Value: The offset, from the start of the complete DDE data, of the data being
passed in the current method invocation.
When the DDE data is too long to fit in the parameter passed by the
RequestData method or GetHotData method, these methods need to be
invoked several times.
Set the value to zero to interrupt the transfer of data. Otherwise do not
change the value.
When data less than 1024 bytes is transferred, PowerCOBOL sets the value
to zero.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility POW-DDEDATAOFFSET PIC S9(9) COMP-5
attribute:
DDEDataStyle Property
Description: Indicates whether the data being transferred from the DDE server is text or
binary.
Used in control(s): DDE
Values (with constants): 10 - Text (POW-DDETEXT)
11 - Binary (POW-DDEBINARY)
If DDEFormat is "CF_TEXT" or "Excel:CSV" set the value to "10 – Text".
Default value: 10 - Text (POW-DDETEXT)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDEDATASTYLE PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 137
DDEFormat Property
Description: Contains the format name of the data being transferred from the DDE
server.
Used in control(s): DDE
Value: The format name supported in the DDE server.
For example:
"CF_TEXT" (Text format),
"Excel: CSV" (Excel Comma-Separated Values)
When requesting data from a DDE server you need to specify a format
name registered in the DDE server.
For application-specific-formats consult the documentation for the DDE
server application.
Default value: "CF_TEXT" - text format
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDEFORMAT PIC X(32)
attribute:
DDEItem Property
Description: Defines the name of the item to be retrieved from the DDE server.
Used in control(s): DDE
Value: The item name as defined by the DDE server application. For example, if
the DDE server is a spreadsheet the item name could be the range of cells
to be returned.
Consult the DDE server application documentation for details of supported
item names.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDEITEM PIC X(128)
attribute:
138 Chapter 4. Properties
DDELinkStyle Property
Description: Indicates the type of link to be set up for the advise loop.
Used in control(s): DDE
Values (with constants): 1 - Hot Link (POW-DDEHOTLINK)
Notifies control when data is updated.
2 - Warm Link (POW-DDEWARMLINK)
Does not notify control when data is updated.
The link style must be set before you start the advise loop.
Default value: 2 - Warm Link (POW-DDEWARMLINK)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDELINKSTYLE PIC S9(4) COMP-5
attribute:
DDEService Property
Description: Contains the service name of the DDE server.
Used in control(s): DDE
Value: The service name of the DDE server. This is the EXE file name of the DDE
server application.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDESERVICE PIC X(128)
attribute:
DDETimeOut Property
Description: Defines the time to wait for a response from the DDE server.
Used in control(s): DDE
Value: The time, in milliseconds, to wait for a response from the DDE server when
a DDE control method is invoked.
Default value: 2000 (milliseconds)
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDETIMEOUT PIC S9(9) COMP-5
attribute:
Chapter 4. Properties 139
DDETopic Property
Description: Contains the topic name of the DDE server.
Used in control(s): DDE
Value: The topic name of the DDE server.
Generally this is the full path name of the DDE server application file.
Consult the DDE server application documentation for details.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DDETOPIC PIC X(260)
attribute:
DecimalPointIsComma Property
Description: Indicates whether the decimal point is a period or comma for the COBOL-
PICTURE render style.
Used in object: RenderText
Values (with constants): True - Decimal point is a comma. (POW-TRUE)
False - Decimal point is a period. (POW-FALSE)
It is only effective when the RenderStyle property is "1 - COBOL PICTURE".
Default value: Depends on the system.
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
140 Chapter 4. Properties
DecisionMaxString Property
Description: Indicates whether input is completed when the input character string
reaches the field length defined by the RenderText object.
Used in control(s): Table TextBox
Values (with constants): True - Fixed input. - Focus moves to the next cell. (POW-TRUE)
False - Not fixed input. - Focus does not move. (POW-FALSE)
When it is true, and a cell is filled, the focus moves to the next cell to the
right, or the first cell of the next line. If there are no cells to move to, the
focus does not move.
When it is False, the focus remains in the cell, but attempts to extend the
data beyond the maximum length are ignored.
The DecisionMaxString property is only effective when the RenderStyle
property is something other than "0 - Standard". When DecisionMaxString is
effective, setting MaxLength to a value greater than the number of
characters specified in the PictureString property has no effect. If the value
of MaxLength is less than the picture definition and the input reaches the
MaxLength number, the Return event is not generated - whether or not you
checked the "Text length reached RenderText definition" in the TextBox
property page.
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 141
Default Property
Description: Indicates the default control in the form.
Used in control(s): CommandButton Custom
Values (with constants): True - This is the default control. (POW-TRUE)
False - This is not the default control. (POW-FALSE)
A black border highlights the default button.
The default control receives a Click event when the ENTER key is pressed.
Only one control in a dialog can be the default control. Setting the value to
True for one control causes the value to be set to False in all the other
controls.
Some controls, such as a multi-line TextBox, use the ENTER key event for
their own purposes. If the focus is in one of these controls the default
control does not get a Click event when the ENTER key is pressed.
Also, if the user moves the focus (a black border) to another button, the
value is changed to False automatically and the Default property of the
button that receives focus is set to True automatically. Thus the new default
button will receive the Click event when the ENTER key is pressed.
Note that if the UnacceptableDefault property is True the value of the
Default property is forced to be False.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DEFBUTTON PIC S9(4) COMP-5
attribute:
DefaultRowHeight Property
Description: Defines the default height of the table rows.
Used in control(s): Table
Value: The default height for each row.
It is only effective when the AutoRowHeight property is False.
Default value: Depends on the font size of the Table control.
COBOL picture: S9(4) COMP-5
OLE data type: OLE_YSIZE_CONTAINER
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
142 Chapter 4. Properties
DelayedFocusEvent Property
Description: Indicates whether the following events are delayed when another event is
waiting.
Delayed events LostFocus event, GotFocus event, and the Edit and Return events of the
ComboBox, Table and TextBox controls.
Used in object: Form
Values (with constants): True - Delays the events. (POW-TRUE)
False - Does not delay the events. (POW-FALSE)
Device Property
Description: Contains the device name to be used by the MCI control.
Used in control(s): MCI
Value: MCI device name.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-MCIDEVICE PIC X(32)
attribute:
Chapter 4. Properties 143
Diffuse Property
Description: Indicates whether dithering should be used when the number of colors for
the image format exceeds the number of colors supported by the system.
Used in control(s): Image
Values (with constants): True - Dithers the image. (POW-TRUE)
False - Does not dither the image. (POW-FALSE)
DisabledFocusAction Property
Description: Indicates the focus behavior when the Enabled or Visible property of a
control that has the focus is changed to False.
Introduced to give the option of compatibility with either Visual Basic's
behavior or the behavior of PowerCOBOL releases other than V4L20.
Used in object: Form
Values (with constants): If the next item to receive focus is an OptionButton group the value
indicates what happens when the group receives the focus (passed by
Enabled or Visible being set to False on a control that had the focus).
0 - Normal (POW-DFA-NORMAL)
(PowerCOBOL behavior, other than release V4L20). Focus is placed on
the selected OptionButton.
1 - Ignore option button value (POW-DFA-IGNOREOPTIONVALUE)
(Visual Basic behavior). Focus is placed on the first OptionButton and the
Value property of the OptionButton is changed to True.
Default value: 0 - Normal (POW-DFA-NORMAL)
Note : For project files created using PowerCOBOL V4.0L20 the default
value is 1. For projects created using V4.0L10, or converted from V3.0, the
default value is 0.
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
144 Chapter 4. Properties
DisabledImageList Property
Description: Defines the resource name of the image list file used for disabled buttons in
the Toolbar control.
Used in control(s): Toolbar
Value: The resource name of a disabled image list file.
The image list contains bitmaps of all the images concatenated into a single
file.
PowerCOBOL determines the location of each bitmap by using the
ImageWidth property of the image list file. (Note: this is different from the
ImageWidth property of the Image control.) You add an image list file to a
module in the project list by using the Insert File option from the pop-up
menu.
The disabled image is used when the Enabled property of a Button object is
False.
Note: You must select "Image List (*.BMP)" as the file type, not "Bitmap
Files (*.bmp)".
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
DisabledImageType Property
Description: Indicates the method of displaying images when the Enabled property of
the control is False.
Used in control(s): CommandButton
Values (with constants): 0 - None: (POW-DISABLEDIMAGE-NONE)
No change to the image.
1 - Simple: (POW-DISABLEDIMAGE-SIMPLE)
Dithers the image by applying a pattern of gray pixels.
2 - 3D: (POW-DISABLEDIMAGE-3D)
Gives the image an indented appearance.
It is only effective when the Enabled property is False, the UseSystemColor
property is True and the ImageName property is set.
Default value: 1 - Simple: (POW-DISABLEDIMAGE-SIMPLE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 145
DisplayRate Property
Description: Indicates whether the control displays percentage figures.
Used in control(s): Graph ProgressIndicator
Values (with constants): True - Displays percentage figures. (POW-TRUE)
False - Does not display percentage figures. (POW-FALSE)
DisplayText Property
Description: Contains the text as displayed by the control.
Used in:
Control TextBox
Object TableCell
Value: The actual text string that is displayed.
If the RenderStyle property is "0-Standard", this is the same as the value of
the Text property.
If the RenderStyle property is not "0-Standard" and you move data to the
Text property, PowerCOBOL displays the data based on the setting of the
RenderText property page. So, the value of the DisplayText property is not
the data you set, but it is the text that is actually displayed by the control.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Reference only.
Execution time access: Reference only.
Backward compatibility None.
attributes:
146 Chapter 4. Properties
Divider Property
Description: Determines whether the separators on the tool bar are displayed.
Used in control(s): Toolbar
Values (with constants): True - Displays the separators. (POW-TRUE)
False - Does not display the separator. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 147
Driver Property
Description: Contains the description of the driver.
Used in control(s): DBAccess
Value: The description of the driver. (e.g. Rdb, SQL Server)
It is set automatically when the control is connected to the common file
data source.
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Reference only.
Execution time access: Reference only.
Backward compatibility None.
attribute:
DropEnabled Property
Description: Determines whether the image can be selected, dragged and dropped.
Used in control(s): Image
Values (with constants): True: The image can be dragged and dropped. (POW-TRUE)
False: The image cannot be dragged and dropped. (POW-FALSE)
It is only effective when the Resource property is set to False.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
148 Chapter 4. Properties
EdgeStyle Property
Description: Indicates the style to be used for the group box border.
EditableLabel Property
Description: Determines whether the control is used as an editable label (i.e. when you
click on the text, it becomes editable).
Used in control(s): TextBox
Values (with constants): True - Uses edit window. (POW-TRUE)
False - Does not use edit window. (POW-FALSE)
When it is True, the control has a display state and an editing state.
In the display state, the string position is governed by the Alignment
property.
In the editing state, you edit character strings in an editing window.
See the description of the TextBox control for the appearance of the edit
window.
It is only effective when the MultiLine property is False.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 149
EditWhenGotFocus Property
Description: Determines whether the Edit event occurs when the edit box receives focus,
and when data can be entered.
Used in control(s): Edit
Values (with constants): True : Event occurs. (POW-TRUE)
False: Event does not occur. (POW-FALSE)
Default value: False: Event does not occur. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Element Property
Description: Contains the element name for a compound device.
Used in control(s): MCI
Value: The element name for a compound device.
A compound device is one that requires a data file to play the device.
Usually the element name is the name of the file to be played by the device.
For example an AVI file for a AVIVideo device, a WAV file for a WaveAudio
device.
If you open a device that is not a compound device, ensure that nothing is
set in the Element property.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-MCIELEMENT PIC X(260)
attributes: POW-SOUNDNAME PIC X(260)
150 Chapter 4. Properties
Enabled Property
Description: Determines whether the control or object is enabled or disabled.
Used in All controls and objects that accept mouse or keyboard input.
controls/objects:
EnableOwnerName Property
Description: Indicates whether to use the owner name.
The owner name is the name of the table or procedure specified in the
TargetName property.
Used in control(s): DBAccess
Values (with constants): True - Uses the owner name. (POW-TRUE)
False - Does not use the owner name. (POW-FALSE)
Expanded Property
Description: Determines whether the Node object is in the expanded state.
Used in object: Node
Values (with constants): True - Node is expanded (POW-TRUE)
False - Node is not expanded (POW-FALSE)
It is only effective when the Node object has one or more child Node
objects.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ExpandedImageIndex Property
Description: Contains the index of the image to use when the Node is in the expanded
state.
Used in object: Node
Value: The index of the image.
The value is an integer greater than zero.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
FileName Property
Description: Holds the name of the file that contains the data to display in the list box
part of the ComboBox control.
Used in control(s): ComboBox
Value: The full path name of the file.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility attribute: POW-FILENAME PIC X(260)
152 Chapter 4. Properties
FileType Property
Description: Indicates the type of file that contains the data to display in the list box part
of the ComboBox control.
Used in control(s): ComboBox
Values (with constants): 0 - Standard Text File (POW-FILETYPE-NORECORD)
1 - CSV (Comma-Separated Value) Format (POW-FILETYPE-CSV)
2 - Fixed Length Format (POW-FILETYPE-FIXEDLENGTH)
For types 1 and 2, you can also specify which field should be used within
the record using the CurFieldNo property.
See the ComboBox control for more details on the file types.
Default value: 1 - CSV (Comma-Separated Value) Format (POW-FILETYPE-CSV)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
FillColor Property
Description: Defines the color to be used inside the Shape control.
Used in control(s): Shape
Values: Refer to "Appendix A. Color Constants" and OLE_COLOR described in
"Appendix C. Data Types" for details on color values.
The FillColor property is not effective when the FillStyle property is "0 -
None".
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: OLE_COLOR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 153
FillStyle Property
Description: Defines the pattern to be used to fill the Shape control.
Used in control(s): Shape
Values (with constants): 0 - None: No pattern (not painted). (POW-FILLSTYLE-NONE)
1 - Solid: Solid color. (POW-FILLSTYLE-SOLID)
2 - Horizontal: Horizontal hatch (lines). (POW-FILLSTYLE-HORIZONTAL)
3 - Vertical: Vertical hatch (lines). (POW-FILLSTYLE-VERTICAL)
4 - Backward diagonal: 45 degree, bottom left to top right, lines.
(POW-FILLSTYLE-BDIAGONAL)
5 - Forward diagonal: 45 degree, top left to bottom right, lines.
(POW-FILLSTYLE-FDIAGONAL)
6 - Cross: Horizontal and vertical cross hatch.
(POW-FILLSTYLE-CROSS)
7 - Diagonal cross: 45 degree cross hatch. (POW-FILLSTYLE-DIAGONAL)
Font Property
Description: Contains a pointer to the Font object associated with the control or object.
Used in controls: CheckBox FileList ListBox Tab
ComboBox FolderList ListView Table
CommandButton Frame OptionButton TextBox
DriveList GroupBox ProgressIndicator TreeView
Edit Label StaticText
Used in object: Form
Value: The Font object contains the defining properties for the font such as name
and size.
At execution time you set or refer to the font properties through the Font
property.
For example, to set the font size in a StaticText control at execution time,
use the following code:
MOVE 20 TO "Size" OF "Font"
OF StaticText1
Default value:
Form System font.
Others Container's Font property
COBOL picture: OBJECT REFERENCE POW-CFONT
OLE data type: VT_DISPATCH
Design time access: Reference only.
(The object pointer contained in the Font property, not the properties of the
Font object)
Execution time access: Reference only.
(The object pointer contained in the Font property, not the properties of the
Font object)
Backward compatibility None.
attribute:
Chapter 4. Properties 155
ForeColor Property
Description: Defines the text color for the control or object.
Used in control(s):
Controls CheckBox FileList Label StaticText
ComboBox FolderList ListBox Table
CommandButton Frame ListView TextBox
Edit Graph OptionButton Toolbar
DriveList GroupBox ProgressIndicator
Objects Form TableCell
Values: Refer to "Appendix A. Color Constants" and OLE_COLOR described in
"Appendix C. Data Types" for more information on color values.
CommandButton It is only effective when the UseSystemColor property is False.
Graph The value is used as the default color for the control.
You should use the DataColor array when you set or refer to the colors of
the data elements.
TableCell If the ForeColor property is set to a different value from the Table control's
ForeColor property, the cell is painted in the value of the TableCell object's
ForeColor property.
If the ForeColor property is set to the same value as the Table control's
ForeColor property, the cell's ForeColor property is initialized and painted in
the value of the Table control 's ForeColor property.
Table If the ForeColor property of a TableCell object is set, the cell is not painted
in the value of the Table control's ForeColor property, it is painted in the
value of the TableCell object's ForeColor.
Toolbar It is only effective when the UseSystemColor property is False and the Style
property is
"1-Flat" or "2-FlatList".
Default value:
Form System's Window Text color.
TableCell Table control's ForeColor property
Others Container's ForeColor property.
COBOL picture: S9(9) COMP-5
OLE data type: OLE_COLOR
Design time access:
TableCell Not accessible.
Others Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-TEXTCOLOR PIC X(4)
attribute:
156 Chapter 4. Properties
FramePath Property
Description: Contains the folder from which images used by the Animation control are
fetched.
Used in control(s): Animation
Value: The pathname of the file containing the animation images.
If a value is not set, PowerCOBOL searches for the image files in the current
folder.
It is only effective when the Resource property is False.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
FrameStyle Property
Descriptions: Defines the style of frame to be used.
Used in controls: Frame
Values (with constants): 0 - GroupBox style (POW-FRAME-GROUPBOX)
1- Panel style (POW-FRAME-PANEL)
Default value: 0 - GroupBox style (POW-FRAME-GROUPBOX)
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
Chapter 4. Properties 157
Ghosted Property
Description: Indicates whether the image color of ListItem objects is lightened.
Used inobject: ListItem
Values (with constants): True - Lightens the colors of the image. (POW-TRUE)
False - Does not lighten the colors of the image. (POW-FALSE)
Default value: False - Does not lighten the colors of the image. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
GraphStyle Property
Description: Defines the style of graph to be used.
Used in control(s): Graph
Values (with constants): 0 - Vertical bar (POW-GRAPHSTYLE-VERTICALBAR)
1 - Horizontal bar (POW-GRAPHSTYLE-HORIZONTALBAR)
2 - Line graph (POW-GRAPHSTYLE-LINE)
3 - Pie chart (POW-GRAPHSTYLE-PIE)
Default value: 0 - Vertical bar (POW-GRAPHSTYLE-VERTICALBAR)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-GRAPHSTYLE PIC S9(4) COMP-5
attribute:
HeaderText Property
Description: Contains the text for the column header.
Used in object: Column
Value: The text to be displayed in the column header cell.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
158 Chapter 4. Properties
HeadText Property
Description: Contains the text to be printed at the head of the page.
Used in control(s): Print
Value: The text of the page header.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-HEADSTRING PIC X(256)
attribute:
Height Property
Description: Defines the height of the control or object.
Used in All sizable controls and the Form object.
controls/objects:
Value: The height of the control, or form, specified in the units defined by the
ScaleMode property.
ComboBox When the Style property is not "0 - Simple" and the AutoSize property is
True, the value does not include the height of the list box part.
DriveList When the AutoSize property is True, the value does not include the height
of the list box part.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access:
ComboBox Set and reference.
Drivelist Set and reference.
Form Not accessible.
Toolbar Reference only.
Others Set and reference.
Execution time access:
ComboBox Set and reference.
Drivelist Set and reference.
Toolbar Reference only.
Others Set and reference.
Backward compatibility POW-POSITION - made up of the following elements. This property
attribute: corresponds to POS-HEIGHT.
01 POSITIONS.
02 POS-X PIC S9(4) COMP-5.
02 POS-Y PIC S9(4) COMP-5.
02 POS-WIDTH PIC S9(4) COMP-5.
02 POS-HEIGHT PIC S9(4) COMP-5.
Chapter 4. Properties 159
Hidden Property
Description: Determines whether the FileList control displays hidden files.
Used in control(s): FileList
Values (with constants): True - Displays hidden files. (POW-TRUE)
False - Does not display hidden files. (POW-FALSE)
Default value: False - Does not display hidden files. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-HIDDEN PIC S9(4) COMP-5
attribute:
HideSelection Property
Description: Indicates whether the selection indicator (a rectangle or reverse video
indicating that a cell or item is selected) is hidden when the control loses
focus.
Used in control(s): ListView Table TreeView
Values (with constants): True - Hides the selection indicator. (POW-TRUE)
False - Does not hide the selection indicator. (POW-FALSE)
Table When the value is False, the rectangle that indicates the selected cell
remains displayed.
ListView, TreeView When the value is False, the selected item remains in reverse video.
Default value:
Table False (POW-FALSE)
ListView, TreeView True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
160 Chapter 4. Properties
Highlight Property
Description: Indicates whether to highlight the text in the control or object.
Used in controls: CheckBox FileList ListBox StaticText
ComboBox FolderList ListView Table
CommandButton Frame OptionButton TextBox
DriveList GroupBox ProgressIndicator Toolbar
Edit Lable
Used in objects: Form TableCell
Values (with constants): True - Highlights the text. (POW-TRUE)
False - Does not highlight the text. (POW-FALSE)
When it is True, the control or object uses the color specified in the
HilightColor property to highlight the text.
PowerCOBOL uses the value for the Form object as the default value for
controls placed on the form.
Edit and TextBox It is only effective when the Password property of the Edit control is False,
or the Password property of a TextBox control, whose EditableLabel
property is False, is False.
Default values:
Form False (POW-FALSE)
TableCell Table control's Highlight property.
Others Container's Highlight property.
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access:
TableCell Not accessible.
Others Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 161
HighlightColor Property
Description: Indicates the color to be used to highlight the text in the control or object.
Used in control(s):
Controls CheckBox FileList ListView Table
ComboBox FolderList OptionButton TextBox
CommandButton Frame ProgressIndicator Toolbar
DriveList GroupBox StaticText
Edit ListBox
Objects Form TableCell
Values: Refer to "Appendix A. Color Constants" and OLE_COLOR described in
"Appendix C. Data Types" for details on color values.
CommandButton It is only effective when the Highlight property is True and the
UseSystemColor property is False.
Toolbar The value indicates the highlight color of the texts for Button objects.
It is only effective when the Highlight property is True, the UseSystemColor
property is False, and the Style property is "1-Flat" or "2-FlatList".
Others It is only effective when the Highlight property is True.
Default value:
Form System's Highlight color.
TableCell Table control's HighlightColor property.
Others Container's HighlightColor property.
COBOL picture: S9(9) COMP-5
OLE data type: OLE_COLOR
Design time access:
TableCell Not accessible.
Others Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-TEXTBKCOLOR PIC X(4)
attribute:
162 Chapter 4. Properties
HotImageList Property
Description: Defines the resource name of an image list file. The file contains button
images to be used when the mouse pointer is moved over buttons in the
Toolbar control.
Used in control(s): Toolbar
Value: The resource name of a hot image list file.
It is only effective when the Style property is "1-Flat" or "2-FlatList".
The image list contains bitmaps of all the images concatenated into a Single
file.
PowerCOBOL determines the location of each bitmap by using the
ImageWidth property of the image list file (this is different from the
ImageWidth property of the Image control). You add an image list file to a
module in the PowerCOBOL project list by using the Insert File option from
the pop-up menu.
Hot images are used when the mouse pointer is moved over a button that
can be clicked.
Note: You must select "Image List (*.BMP)" as the file type, not "Bitmap
Files (*.bmp)".
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
HScrollBar Property
Description: Determines whether to use a horizontal scrollbar in the TextBox control.
Used in control(s): TextBox
Values (with constants): True: Control displays a horizontal scrollbar. (POW-TRUE)
False: Control does not display a horizontal scrollbar. (POW-FALSE)
It is only effective when the MultiLine property is True.
Default value: False: Control does not display a horizontal scrollbar. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 163
Icon Property
Description: Defines the icon used by the form.
Used in object: Form
Values (with constants): 0 - Default: Depends on the system. It is usually the Windows logo.
(POW-ICON-DEFAULT)
1 - Application: Small image of a window. (POW-ICON-APPLICATION)
2 - Hand: White "X" on red circle. (POW-ICON-HAND)
3 - Question: "?" in a white speech balloon. (POW-ICON-QUESTION)
4 - Exclamation: "!" in a yellow triangle. (POW-ICON-EXCLAMATION)
5 - Asterisk: "i" in a white speech balloon. (POW-ICON-ASTERISK)
6 - Winlogo: The Windows logo. (POW-ICON-WINLOGO)
99 - Custom: Image specified in the IconName property.
(POW-ICON-CUSTOM)
Note: You cannot use the COBOL Run-time Environment Variables
@IconDLL and @IconName to specify the icon used by the form
Default value: 0 - Default: (POW-ICON-DEFAULT)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-ICON PIC X(14)
attribute:
IconIndex Property
Description: Defines the index of the icon image to be used for the ListItem object.
Used in object: ListItem
Value: The index of the icon image.
The value is an integer greater than zero.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
164 Chapter 4. Properties
IconName Property
Description: Contains the resource name of the icon used by the form.
Used in object: Form
Value: The resource name of the icon.
It is only effective when the Icon property is "99-Custom".
You can only set the resource name in the Resource property page after
you register the file in the module. You add an icon file to a module in the
project list by using the Insert File option from the pop-up menu.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-ICON PIC X(14)
attribute:
Icons Property
Description: Defines the resource name of the image list file used by the ListView control
when the control displays large icons.
Used in control(s): ListView
Values: The resource name of the image list file containing the large icon images.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 165
ImageCount Property
Description: Contains the number of images in the image file.
Used in control(s): Image
Value: The number of images in the image file. The image file can be a file of
icons, or Kodak PhotoCD (.pcd) images.
If another type of image is used the value is 1.
If no image is specified the value is 0.
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Reference only.
Execution time access: Reference only.
Backward compatibility None.
attribute:
ImageHeight Property
Description: Contains the height of the image.
Used in control(s): Image
Value: The height of the image expressed in the units defined in the ScaleMode
property.
Default value: None.
COBOL picture: COMP-1
OLE data type: OLE_YSIZE_CONTAINER
Design time access: Reference only.
Execution time access: Reference only.
Backward compatibility POW-IMAGESIZE - made up of the following elements.
attribute: This property corresponds to SZ-HEIGHT.
01 IMAGE-SIZE.
02 SZ-WIDTH PIC S9(4) COMP-5.
02 SZ-HEIGHT PIC S9(4) COMP-5.
166 Chapter 4. Properties
ImageIndex Property
Description: Defines the index of the image to use in the control or object.
Used in:
Control Image
Objects Button Node
Value: The index of the image.
The value is an integer greater than zero.
For the Image control, it is the index within the Kodak PhotoCD image file
"Overview.pcd".
Default value:
Image 1
Others None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access:
Node Not accessible.
Others Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ImageLeft Property
Description: Defines the X coordinate, within the image, where the image display begins.
Used in control(s): Image
Value: The X coordinate, within the image, where the image display begins.
It is expressed in the units defined in the ScaleMode property.
For example if the ImageLeft property is 10 pixels, the control displays the
image from the 10th pixel right.
If ImageMode is set to "2 - Auto", the value of ImageLeft property changes
according to the horizontal scroll position of the image.
Default value: 0
COBOL picture: COMP-1
OLE data type: OLE_XPOS_CONTAINER
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 167
ImageList Property
Description: Contains the resource name of the image list file that contains the images
for the Toolbar or TreeView control.
Used in control(s): Toolbar TreeView
Value: The resource name of the image list file.
The image list file contains bitmaps of all the images concatenated into a
single file.
PowerCOBOL determines the location of each bitmap by using the
ImageWidth property (this is different from the ImageWidth property of the
Image control) of the image list file. You add an image list file to a module
in the project list by using the Insert File option from the pop-up menu.
Note: You must select "Image List (*.BMP)" as the file type, not "Bitmap
Files (*.bmp)".
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ImageMode Property
Description: Defines the method to be used for displaying the image.
Used in control(s): Image
Values (with constants): 0 - Standard: (POW-IMAGEMODE-STANDARD)
The image is displayed within the control, clipped if necessary.
1 - Stretch: (POW-IMAGEMODE-STRETCH)
The image is expanded or contracted to fit the size of the control.
2 - Auto: (POW-IMAGEMODE-AUTO)
If the image is smaller than the size of the control, the control is shrunk
to fit the image. If the image is larger than the size of the control,
scrollbars are inserted.
3 - Adjust: (POW-IMAGEMODE-ADJUST)
The size of the control is adjusted to match the size of the image.
Default value: 1 - Stretch: (POW-IMAGEMODE-STRETCH)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-IMAGEMODE PIC S9(4) COMP-5
attribute: POW-STRETCH PIC S9(4) COMP-5
168 Chapter 4. Properties
ImageName Property
Description: Contains the name of the file or resource containing the image.
Used in control(s): CommandButton Image
Value: The name of the file when the Resource property is False.
The name of the resource when the Resource property is True.
Image System generates a Change event when the ImageName is changed.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
CommandButton POW-IMAGENAME PIC X(260)
Image POW-IMAGENAME PIC X(260)
POW-METANAME PIC X(260)
ImageTop Property
Description: Defines the Y coordinate, within the image, where the image display begins.
Used in control(s): Image
Value: The Y coordinate, within the image, where the image display begins.
It is expressed in the units defined in the ScaleMode property.
For example if the ImageTop property is 10 pixels, the control displays the
image from the 10th pixel down.
If the ImageMode property is "2 - Auto", the value of the ImageTop
property changes according to the vertical scroll position of the image.
Default value: 0
COBOL picture: COMP-1
OLE data type: OLE_YPOS_CONTAINER
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 169
ImageWidth Property
Description: Defines the width of the image.
Used in control(s): Image
Value: The width of the image expressed in the units defined in the ScaleMode
property.
Default value: None.
COBOL picture: COMP-1
OLE data type: OLE_XSIZE_CONTAINER
Design time access: Reference only.
Execution time access: Reference only.
Backward compatibility POW-IMAGESIZE - made up of the following elements.
attribute: This property corresponds to SZ-WIDTH.
01 IMAGE-SIZE.
02 SZ-WIDTH PIC S9(4) COMP-5.
02 SZ-HEIGHT PIC S9(4) COMP-5.
IMEMode Property
Description: Specifies the IME mode. (Useful for applications that must operate in non-
single-byte character environments.)
Used in control(s):
Controls ComboBox Edit Table TreeView
Custom ListView TextBox
Object TableColumn
Values (with constants): 0 - None (POW-IMENOOPERATION)
1 - On (POW-IMEON)
2 - Off (POW-IMEOFF)
3 - Disable (POW-IMEDISABLE)
4 - Hiragana Full (POW-IMEDBCSHIRAGANA)
5 - Katakana Full (POW-IMEDBCSKATAKANA)
6 - Katakana Half (POW-IMESBCSKATAKANA)
7 - Alphabet Full (POW-IMEDBCSALPHABET)
8 - Alphabet Half (POW-IMESBCSALPHABET)
Default value: 0 - None (POW-IMENOOPERATION)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
170 Chapter 4. Properties
Indentation Property
Description: Defines the size of the indent from the parent Node object to the child Node
object.
Used in control(s): TreeView
Value: The size of the indent expressed in the units defined by the ScaleMode
property.
Default value: Depends on the system.
COBOL picture: COMP-1
OLE data type: OLE_XSIZE_CONTAINER
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Index Property
Description: Defines the index of the control when it is part of an array.
Used in control(s): All controls apart from the GroupBox control.
Value: The index of a control within an array.
The value is an integer greater than zero.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 171
InputFormat Property
Description: Defines the order in which the year, month and day are entered for dates.
Note: The DateStyle and DateFormat properties determine how the date is
displayed.
Used in object: RenderText
Value: The format is defined by entering a permutation of the following three
strings:
yyyy : 4 digit year (e.g. 2003)
MM : Numeric month (1 to 12)
dd : Numeric day (1 to 31)
e.g. "yyyyMMdd" or "MMddyyyy"
Note that:
- The InputFormat property is only effective when the RenderStyle property
is "2-Date".
- You can only specify each of the above strings one time.
e.g. Mmddyyyy
yyyyMMdd
yyyyMMddMM <= incorrect
- The strings are case sensitive.
e.g. mmddyyyy <= incorrect
MMddYYYY <= incorrect
- You must specify all of the three strings.
e.g. MMdd <= incorrect
yyyyMM <= incorrect
- You cannot insert other strings to this format.
e.g. MM,dd,yyyy <= incorrect
yyyy-MM-dd <= incorrect
- The InputFormat is entered using strings to allow expansion to many
formats in the future.
When you input the date at execution time, you can use the delimiters,
slash (/), hyphen (-), period (.) or the delimiter specified to the system
(Date separator in the Date tab of Regional Settings in the Control Panel).
For example, if you specified the InputFormat "MMddyyyy", you can input
the date at execution time as any of the following strings:
12/31/2003
12.31. 2003
12-31-2003
12312003
RenderText:
When you refer to the Text property, the RenderText object converts the
string to the InputFormat. For example, if you:
- specify the InputFormat "ddyyyyMM", and
- input the date at execution time "31. 2003.12", and
172 Chapter 4. Properties
- code:
01 WK1 PIC X(8).
...
PROCEDURE DIVISION.
...
MOVE "Text" OF CmText1 TO WK1.
The value stored in WK1 is "31200312".
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Interval Property
Description: Defines the interval between Animation image changes or Timer events for
the Timer control.
Used in control(s): Animation Timer
Values: 0 to 65535 (milliseconds)
Animation The Animation control produces an animation effect by displaying
successive images. The value of Interval determines the time between
image switches in milliseconds.
A low value of Interval may affect the operation of the application.
The image switch may not always happen precisely at the specified interval,
depending on the state of the system.
Timer The interval between Timer events, specified in milliseconds.
Default values:
Animation 300
Timer 1000
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
Timer POW-INTERVAL PIC S9(4) COMP-5
Chapter 4. Properties 173
IsCheckBtn Property
Description: Indicates whether checkboxes are inserted to the left of each item in the
ListBox control.
Used in control(s): ListBox
Values (with constants): True - Inserts checkboxes. (POW-TRUE)
False - Does not insert checkboxes. (POW-FALSE)
IsChecked Property
Description: Contains a flag indicating whether an item in the ListBox control is checked.
The flags are held in an array, so always use an index when referencing the
IsChecked property.
Used in control(s): ListBox
Values (with constants): True - Checked. (POW-TRUE)
False - Not checked. (POW-FALSE)
It is only effective when the IsCheckBtn property is True.
The index can be set from 1 to the value of the ListCount property.
Default value: False - Not checked. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
174 Chapter 4. Properties
IsQuery Property
Description: Indicates whether the items displayed in the list box part are filtered by the
characters entered in the text box part of the ComboBox control.
Used in control(s): ComboBox
Values (with constants): True - Filters the list box part. (POW-TRUE)
False - Does not filter the list box part. (POW-FALSE)
It is only effective when the Style property is
"0 - Simple" or "1 - DropDown".
Default value: False - Does not filter the list box part. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Italic Property
Description: Indicates whether the font is italic.
Used in object: Font
Values (with constants): True - Italic. (POW-TRUE)
False - Not italic. (Normal) (POW-FALSE)
Default value: Container's Italic property
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-ITALIC PIC S9(4) COMP-5
attribute:
KeysetSize Property
Description: Defines the key set size.
Used in control(s): DBAccess
Values: 0 to 65535
It is only effective when CursorType is
"1 - SQL_CURSOR_KEYSET_DRIVEN".
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
LabelEdit Property
Description: Indicates whether node labels can be edited within the control when the
label is clicked.
Used in control(s): ListView TreeView
Values (with constants): True - Labels can be edited. (POW-TRUE)
False - Labels cannot be edited. (POW-FALSE)
ListView The edited string changes the Text property of the ListItem object.
TreeView The edited string changes the Text property of the Node object.
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 177
LabelWrap Property
Description: Defines whether long label text wraps to new lines.
Used in control(s): ListView
Values (with constants): True: Text wraps. (POW-TRUE)
False: Text does not wrap. (POW-FALSE)
It is only effective when the LVStyle property is "0 - Large icon" or "1 -
Small icon".
Default value: True: Text wraps. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
LargeStep Property
Description: Defines the amount of the large step movement in a scroll bar or slider.
Used in control(s): ScrollBar Slider
Values:
ScrollBar -65535 to 65535
The "large step" is the amount of movement when the mouse is clicked in
the scrollbar shafts (the areas between the arrows and the scroll box), or
when the PageDown or PageUp keys are pressed.
Slider 0 to 65535
The "large step" is the amount of movement when the mouse is clicked in
the slider shafts (the areas before and after the thumb), or when the
PageDown or PageUp keys are pressed.
Default value: 20
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-LARGESTEP PIC S9(9) COMP-5
attribute:
178 Chapter 4. Properties
Layout Property
Description: Indicates how an image is aligned within the control.
Used in control(s): CommandButton
Values (with constants): 0 - Horizontal: Aligned to the left. (POW-LAYOUT-HORIZONTAL)
1 - Vertical: Aligned to the top. (POW-LAYOUT-VERTICAL)
Default value: 0 - Horizontal: Aligned to the left. (POW-LAYOUT-HORIZONTAL)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Left Property
Description: Defines the X coordinate of the left upper corner of the controls or objects.
Used in controls/object: All controls and the Form object.
Value: The X coordinate expressed in the units defined in the ScaleMode property.
Controls Relative to the left upper corner of the Form or control, which is identified in
the Container property.
Form Relative to the left upper corner of the screen.
You can only set the value when the StartUpPosition property is "4 -
Manual".
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access:
Toolbar Set and reference. - You can only set the value when the Align property is
"0 – None" or "4 - Right".
Others Set and reference.
Execution time access:
DBAccess, DDE, Not accessible.
ExcelConnection, Timer,
and Print
Toolbar Set and reference. - You can only set the value when the Align property is
"0 – None" or "4 - Right".
Others Set and reference.
Backward compatibility POW-POSITION - made up of the following elements.
attribute: This property corresponds to POS-X.
01 POSITIONS.
02 POS-X PIC S9(4) COMP-5.
02 POS-Y PIC S9(4) COMP-5.
02 POS-WIDTH PIC S9(4) COMP-5.
02 POS-HEIGHT PIC S9(4) COMP-5.
Chapter 4. Properties 179
LeftMargin Property
Description: Defines the width of the left-hand margin when the form is printed.
Used in control(s): Print
Value: The width of the left margin in the units defined by the PaperScaleUnit
property.
Default value: 0.6 inch
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-LEFTMARGIN PIC S9(9) COMP-5
attribute:
ListCount Property
Description: Contains the number of items in the list box part.
Used in control(s): ComboBox FileList ListBox
DriveList FolderList
Value: The number of items in the list box part.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-COUNT PIC S9(4) COMP-5
attribute:
ListIndex Property
Description: Contains the index of the selected item in the list box part.
Used in control(s): ComboBox FileList ListBox
DriveList FolderList
Value: The index of the selected item.
The value is an integer from 1 to the value of the ListCount property.
0 means nothing is selected.
FileList and The index of the selected item in the list box part.
ListBox
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility attribute: POW-SELECT PIC S9(4) COMP-5
180 Chapter 4. Properties
LockType Property
Description: Indicates the type of locks placed on records during editing.
Used in controls: ADODataSource
Used in Objects: None.
Values (with constants): -1 - adLockUnspecified: (POW-ADODB-ADLOCKSPECIFIED)
Does not specify a type of lock.
1 - adLockReadOnly: (POW-ADODB-ADLOCKREADONLY)
Indicates read-only records.
2 - adLockPessimistic: (POW-ADODB-ADLOCKPESSIMISTIC)
Indicates pessimistic locking, record by record.
3 - adLockOptimistic: (POW-ADODB-ADLOCKOPTIMISTIC)
Indicates optimistic locking, record by record.
4 - adLockBatchOptimistic: (POW-ADODB-ADLOCKBATCHOPTIMISTIC)
Indicates optimistic batch updates.
Consult the ADO documentation for details about lock types.
Note: The value may be ignored depending on the kind of OLE DB Provider
to which you connected.
Default value: 3 - adLockOptimistic: (POW-ADODB-ADLOCKOPTIMISTIC)
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
Lower Property
Description: Defines the lower limit of the range of data shown in the graph.
Used in control(s): Graph
Value: The lower limit of the range of data.
It is not effective when the GraphStyle property is "3 - Pie".
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-LOWER PIC S9(9) COMP-5
attribute:
182 Chapter 4. Properties
LVStyle Property
Description: Defines the display style of the ListItem objects.
Used in control(s): ListView
Values (with constants): 0 - Large icon: (POW-LVSTYLE-LARGEICON)
Large icons with the list item label below.
1 - Small icon: (POW-LVSTYLE-SMALLICON)
Small icons with the list item label to the right. Listed left to right in
rows.
2 - List: (POW-LVSTYLE-LIST)
Small icons with the list item label to the right. Listed top to bottom, left
to right.
3 - Report: (POW-LVSTYLE-REPORT)
Detailed display. Small icons with the label and other information to the
right. Listed vertically with one row per item.
Default value: 0 - Large icon: (POW-LVSTYLE-LARGEICON)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Max Property
Description: Defines the maximum value for the control.
Used in control(s): ProgressIndicator Scrollbar Slider
Values:
ProgressIndicator, 0 to 65535
Slider The value must be greater than the Min property.
Scrollbar -32768 to 32767
The value must be greater than the Min property, and satisfy the condition:
Min <= Max – (ScrollPage – 1)
Default value: 100
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
Scrollbar POW-MAX PIC S9(4) COMP-5
Chapter 4. Properties 183
MaxButton Property
Description: Determines whether the maximize button is displayed in the title bar.
Used in object: Form
Values (with constants): True - Display the maximize button. (POW-TRUE)
False - Do not display the maximize button. (POW-FALSE)
Default value: True - Display the maximize button. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
MaxLength Property
Description: Defines the maximum number of characters to be input.
Used in control(s): Edit TextBox
Value:
Edit The maximum number of characters.
The value is an integer greater than zero.
A value of zero means there is no limit.
TextBox The maximum number of characters.
The value is an integer greater than zero.
A value of zero means there is no limit.
If you press the ENTER key, it corresponds to 2 characters when the
MultiLine property is True.
If the RenderStyle property is not "0 – Standard", setting MaxLength to a
value greater than the number of characters specified in the PictureString in
the RenderText property page has no effect.
The setting of the MaxLength property is unrelated to the generation of the
Return event.
Default value: 0 (there is no limit)
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
184 Chapter 4. Properties
MediaLength Property
Description: Contains the overall playing time of the media.
Used in control(s): MCI
Value: The overall playing time expressed in the units specified in the TimeFormat
property.
It is only accessible when the device is open (between the device being
opened and closed).
See MediaLength Sample for code for techniques of extracting the track,
minute, second and frame information from the this property.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-MCIMEDIALEN PIC X(8)
attribute:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MEDIA-LEN.
02 LEN PIC S9(9)COMP-5.
02 LEN-X REDEFINES LEN PIC X(4).
01 MEDIA-LEN-EXTRACT.
02 LEN-EXTRACT PIC S9(9)COMP-5.
02 LEN-EXTRACT-X REDEFINES LEN-EXTRACT PIC X(4).
01 MCI-MEDIALEN.
02 MCI-TRACK PIC S9(4)COMP-5.
02 MCI-MINUTE PIC S9(4)COMP-5.
02 MCI-SECOND PIC S9(4)COMP-5.
02 MCI-FRAME PIC S9(4)COMP-5.
PROCEDURE DIVISION.
*> Code to extract time in form track/minute/second/frame.
MOVE 10 TO "TimeFormat" OF MCI1.
MOVE "MediaLength" OF MCI1 TO LEN.
MOVE 0 TO LEN-EXTRACT.
*> Acquire track field
*> (Taking account of 80x86 byte reversal).
MOVE LEN-X(1:1)TO LEN-EXTRACT-X(1:1).
MOVE LEN-EXTRACT TO MCI-TRACK.
*> Acquire minute field
MOVE LEN-X(2:1)TO LEN-EXTRACT-X(1:1).
MOVE LEN-EXTRACT TO MCI-MINUTE.
*> Acquire second field
MOVE LEN-X(3:1)TO LEN-EXTRACT-X(1:1).
MOVE LEN-EXTRACT TO MCI-SECOND.
*> Acquire frame field
MOVE LEN-X(4:1)TO LEN-EXTRACT-X(1:1).
MOVE LEN-EXTRACT TO MCI-FRAME.
Chapter 4. Properties 185
MediaPosition Property
Description: Contains the current playing position of the media.
Used in control(s): MCI
Value: The current playing position of the media, expressed in the units defined in
the TimeFormat property.
It is only accessible when the device is open.
See MediaLength Sample for techniques of extracting track, minute, second
and frame information.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility POW-MCIMEDIAPOS PIC X(8)
attribute:
MenuBarName Property
Description: Contains the name of the Menu object that defines the menubar of the
form.
Used in object: Form
Value: The name of Menu object. (Name property)
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
186 Chapter 4. Properties
MenuBreak Property
Description: Determines whether the menu is split immediately before the menu item.
Used in object: MenuItem
Values (with constants): 0 - Not MenuBreak: (POW-NOBREAK)
Menu is not split.
1 - MenuBreak: (POW-BREAK)
Menu is split into two or more columns.
2 - MenuBarBreak: (POW-BARBREAK)
Menu is split with a vertical bar between columns.
Default value: 0 - Not MenuBreak: (POW-NOBREAK)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Min Property
Description: Defines the minimum value for the control.
Used in control(s): ProgressIndicator Scrollbar Slider
Values:
ProgressIndicator, 0 to 65535
Slider The value must be less than the Max property.
Scrollbar -32768 to 32767
The value must be less than the Max property and satisfy the condition:
Min <= Max – (ScrollPage – 1)
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
ScrollBar POW-MIN PIC S9(4) COMP-5
Chapter 4. Properties 187
MinButton Property
Description: Determines whether the minimize button is displayed in the title bar.
Used in control(s): Form
Values (with constants): True - Displays the minimize button. (POW-TRUE)
False - Does not display the minimize button. (POW-FALSE)
Default value: True - Displays the minimize button. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
MouseIconName Property
Description: Defines the resource name of a mouse pointer for the form.
Used in control: Form
Value: The resource name for a mouse pointer.
It is only effective when the MousePointer property is "99-Custom".
You can only set the resource name on the Resource property page after
you register the file in the module (using the Insert File function from the
pop-up menu in the project view).
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-CURSOR PIC X(14)
attribute:
188 Chapter 4. Properties
MousePointer Property
Description: Indicates the style of the mouse pointer.
Used in control(s): Form
Values (with constants): 0 - Default: Standard pointer. (POW-MP-DEFAULT)
1 - Arrow: Arrow pointer. (POW-MP-ARROW)
2 - Cross: Cross pointer. (POW-MP-CROSS)
3 - Ibeam: Ibeam pointer. (POW-MP-IBEAM)
4 - Icon: Empty pointer. (POW-MP-ICON)
5 - Size: Standard arrow pointer - no special image currently assigned to
this value. Use "14 - SizeAll" instead of "5 - Size".
(POW-MP-SIZE)
6 - SizeNESW: Two arrows pointing diagonally to the upper right and lower
left corners. (POW-MP-SIZENESW)
7 - SizeNS: Two arrows pointing vertically up and down. (POW-MP-SIZENS)
8 - SizeNWSE: Two arrows pointing diagonally to the upper left and lower
right corners. (POW-MP-SIZENWSE)
9 - SizeWE: Two arrows pointing horizontally left and right.
(POW-MP-SIZEWE)
10 - UpArrow: Single upward arrow pointer. (POW-MP-UPARROW)
11 - Wait: Hourglass pointer. (POW-MP-WAIT)
12 - AppStarting: Arrow and hourglass pointer. (POW-MP-APPSTARTING)
13 - No: Prohibit sign pointer. (POW-MP-NO)
14 - SizeAll: Arrows in four directions. (POW-MP-SIZEALL)
15 - Help: Arrow and question mark pointer. (POW-MP-HELP)
99 - Custom: (POW-MP-CUSTOM)
Mouse pointer specified in the MouseIconName property.
Default value: 0 - Default (standard)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-CURSOR PIC X(14)
attribute:
Chapter 4. Properties 189
Moveable Property
Description: Indicates whether the form is moveable when the title bar or system menu
is operated.
Used in object: Form
Values (with constants): True - Moveable. (POW-TRUE)
False - Not moveable. (POW-FALSE)
Note that you can move the form by invoking the MoveForm method and
setting the Top property or Left property, even if the value is False.
Default value: True - Moveable. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
MultiLine Property
Description: Indicates whether the control has multiple lines.
MultipleInstance Property
Description: Indicates whether multiple instances of a form can be created at execution time.
(On Windows two or more instances of an application that includes the form can
be executing at the same time.)
Used in object: Form
Values (with constants): True - Can create multiple instances. (POW-TRUE)
False - Cannot create multiple instances. (POW-FALSE)
It is only effective when the ScriptLanguage property of the Module is "1 -
OOCOBOL Language Mode". You cannot create multiple instances when the
property is "0 - COBOL85 Language Mode"
Default value: False - Cannot create multiple instances. (POW-FALSE)
COBOL PICTURE S9(4) COMP-5
OLE data type: VT-BOOL
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
MultiSelect Property
Description: Defines the selection mode in the list box part for the control.
Used in control(s): FileList ListBox ListView
Values (with constants):
ListView True: Multiple items can be selected. (POW-TRUE)
False: Multiple items cannot be selected. (POW-FALSE)
FileList, ListBox 0 - Single select: (POW-MULTISELECT-NONE)
Only one item can be selected at a time.
1 - Multiple select: (POW-MULTISELECT-SIMPLE)
Two or more items can be selected at a time.
2 - Extended select: (POW-MULTISELECT-EXTENDED)
Like the multiple selection option, but with the ability to select a single
range as well as multiple discrete items.
Default value:
ListView False: Multiple items cannot be selected. (POW-FALSE)
FileList, ListBox 0 - Single select: (POW-MULTISELECT-NONE)
COBOL PICTURE S9(4) COMP-5
OLE data type
ListView VT_BOOL
FileList, ListBox VT_I2
Design time access: Set and reference.
Execution time access:
ListView Set and reference.
FileList, ListBox Reference only.
Backward compatibility attribute: None.
Chapter 4. Properties 191
Name Property
Description: Contains the name of the control or object.
Used in:
Controls All controls
Objects Font Form Menu MenuItem
Values:
Font The name of the font to be used.
Others The name of the control or object.
Default value:
Font Depends on the container.
Others A name generated by PowerCOBOL.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access:
Font Set and reference.
Form Not accessible.
Others Reference only.
Backward compatibility None.
attribute:
Normal Property
Description: Indicates whether to display normal files (those without special attribute
settings).
Used in control(s): FileList
Values (with constants): True - Display normal files. (POW-TRUE)
False - Do not display normal files. (POW-FALSE)
Normal files are those that do not have the hidden, system, archive or read-
only attributes set.
Default value: True - Display normal files. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-NORMAL PIC S9(4) COMP-5
attribute:
192 Chapter 4. Properties
OptionButtonClickMode Property
Descriptions: Determines the condition that generates the Click event of the OptionButton
control.
Used in controls: None.
Used in objects: Form
Value (with constants): 0 : Normal (POW-CLICKMODE-NORMAL)
The Click event is not generated until the left mouse button is released.
1: When left button is pressed (POW-CLICKMODE-LBUTTONDOWN)
The Click event is generated when the left mouse button is pressed.
Default value: 0 : Normal (POW-CLICKMODE-NORMAL)
Note : For projects created using V4.0 or V5.0, the default value is 1.
COBOL PICTURE: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
Orientation Property
Description: Defines the orientation of the control.
Used in control(s): ProgressIndicator ScrollBar Slider Tab
Values (with constants):
Tab 0 - Top (POW-TAB-ORIENTATION-TOP)
1 - Bottom (POW-TAB-ORIENTATION-BOTTOM)
2 - Left (POW-TAB-ORIENTATION-LEFT)
3 - Right (POW-TAB-ORIENTATION-RIGHT)
Indicates where the tabs are placed on the control.
Others 0 - Horizontal (POW-ORIENTATION-HORIZONTAL)
1 - Vertical (POW-ORIENTATION-VERTICAL)
Default value:
Tab 0 - Top (POW-TAB-ORIENTATION-TOP)
Others 0 - Horizontal (POW-ORIENTATION-HORIZONTAL)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access:
ProgressIndicator and Set and reference.
Slider
ScrollBar and Tab Reference only.
Backward compatibility None.
attribute:
194 Chapter 4. Properties
PageCount Property
Description: Defines the number of tab pages in the Tab control.
Used in control: Tab
Value: An integer from 1 to 99.
Default value: 1
COBOL picture S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
PageNoFormat Property
Description: Defines the format for printed page numbers.
Used in control(s): Print
Values (with constants): 0 - None: Does not print page numbers. (POW-NOPAGENO)
1 - Page: Prints the current page number. (POW-CURRENTPAGE)
2 - Page/Total: Prints the current page number and total number of pages.
(POW-CURRENTTOT)
Default value: 1 - Page: (POW-CURRENTPAGE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-PAGENOFORMAT PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 195
PaperOrientation Property
Description: Defines the orientation of the image on the paper.
Used in control(s): Print
Values (with constants): 0 - Auto: (POW-DEFAULTORIENTATION)
Uses the printer setting.
1 - Portrait: (POW-PORTRAIT)
Prints the image length-wise on the paper.
2 - Landscape: (POW-LANDSCAPE)
Prints the image across the paper.
Default value: Depends on the target printer.
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-PAPERDIRECT PIC S9(4) COMP-5
attribute:
196 Chapter 4. Properties
PaperScaleUnit Property
Description: Defines the unit of measurement used for lengths associated with print
output.
Used in control(s): Print
Values (with constants): 0 - mm (millimeters) (POW-MM)
1 - inch (POW-INCH)
Default value: 1 - inch (POW-INCH)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
PaperType Property
Description: Defines the size of paper for the print output.
Used in control(s): Print
Values (with constants): 0 - Auto (depends on the target printer.) (POW-DEFAULTSIZE)
1 - Letter 216x279 mm / Letter 8.5x11 inch (POW-PAPERLETTER)
5 - Legal 216x356 mm / Legal 8.5x14 inch (POW-PAPERLEGAL)
8 - A3 297x420 mm / A3 11.5x16.5 inch (POW-PAPERA3)
9 - A4 210x297 mm / A4 8.2x11.5 inch (POW-PAPERA4)
11 - A5 148x210 mm / A5 5.8x8.2 inch (POW-PAPERA5)
12 - B4 257x364 mm / B4 10x14.3 inch (POW-PAPERB4)
13 - B5 182x257 mm / B5 7x10 inch (POW-PAPERB5)
Default value: Depends on the target printer.
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-PAPERTYPE PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 197
Parent Property
Description: Contains a pointer to the parent object.
Used in:
Controls All controls
Object Node
Values:
Controls A pointer to the GroupBox control if the control is pasted on the GroupBox
control.
In the other cases, it's a pointer to the Form object.
Node A pointer to the parent Node object.
Default value: None.
COBOL picture:
Controls OBJECT REFERENCE POW-COBJECT
Node OBJECT REFERENCE POW-CNODE
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
198 Chapter 4. Properties
Password Property
Description: Contains a password string or indicates a password mode for a TextBox.
Used in control(s): ADODataSource DBAccess Edit TextBox
Values:
ADODataSource and The input password is enabled while the project file is opened at design
DBAccess time. The value of this property is cleared at closing of the project and the
password is not saved. If you don't set a value in the procedure code, the
database may prompt for the password in another way when you connect
to the database.
Edit True - Treats the characters as a password.
Echoes the PasswordChar value and not the value the user types.
False - Does not treat the characters as a password.
TextBox True - Treats the characters as a password.
Echoes the PasswordChar value and not the value the user types.
False - Does not treat the characters as a password.
It is only effective when the MultiLine property is False.
When the value is True, you should set the IMEMode property to "3 -
Disable".
Default value:
ADODataSource and None.
DBAccess
TextBox False - Does not treat the characters as a password.
COBOL PICTURE:
ADODataSource and X, up to 8192 bytes
DBAccess
TextBox S9(4) COMP-5
OLE Data type:
ADODataSource and VT_BSTR
DBAccess
TextBox VT_BOOL
Design time access:
ADODataSource and Set and reference.
TextBox
DBAccess Not accessible.
Execution time access:
ADODataSource and Set and reference.
DBAccess
TextBox Reference only.
Backward compatibility
attribute:
DBAccess POW-DBPASSWORD PIC X(32)
Others None.
Chapter 4. Properties 199
PasswordChar Property
Description: Defines the character to be echoed when a password is typed into the text
box.
Used in control(s): Edit TextBox
Value: The character to be echoed.
You can only set a single character.
It is only effective when the Password property is True.
Default value: * (Asterisk)
COBOL picture: X
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Path Property
Description: Contains a path name.
Used in:
Controls FileList FolderList
Object Node
Values:
Node An absolute path made up of the character strings defined in the Text
properties of the Node objects for the TreeView control.
For example if the TreeView has the structure:
+aaa
+bbb
+ccc
the path value of Node object whose Text property is "ccc" is:
aaa\bbb\ccc
where "\" is the character defined in the PathSeparator property of the
TreeView control.
Others The relative or absolute path of the current folder.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access:
Node Reference only.
Others Set and reference.
Backward compatibility
attribute:
Node POW-PATH PIC X(260)
200 Chapter 4. Properties
PathSeparator Property
Description: Defines the path separator character – the character used to separate folder
names within a path.
Used in control(s): TreeView
Value: The character used to separate folder names.
This is used in the Path property of the Node object.
Default value: \ (back slash)
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Pattern Property
Description: Contains the string to be used as a filter for the file names displayed in the
FileList.
Used in control(s): FileList
Value: A string to be used as a filter.
The string can contain the wild-card characters "*" and "?".
For example to limit the list to only those files with a "COB" extension code:
MOVE "*.COB" TO "Pattern" OF FileListName
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-MASK PIC X(256)
attribute:
Chapter 4. Properties 201
PcdColorType Property
Description: Defines the number of colors used in a Kodak Photo CD image file.
Used in control(s): Image
Values (with constants): 0 - 24bit color (POW-PCDCOLORTYPE-24BITCOLOR)
1 - 256 color (POW-PCDCOLORTYPE-256COLOR)
2 - 16 color (POW-PCDCOLORTYPE-16COLOR)
3 - 256 gray scale color (POW-PCDCOLORTYPE-256GRAY)
Default value: 0 - 24bit color (POW-PCDCOLORTYPE-24BITCOLOR)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
PcdResolution Property
Description: Defines the resolution for a Kodak Photo CD image file.
Used in control(s): Image
Values (with constants): 0 - BASE_OVER_64 (64 x 96) (POW-PCDRESOLUTION-BASE-OVER-64)
1 - BASE_OVER_16 (128 x 192) (POW-PCDRESOLUTION-BASE-OVER-16)
2 - BASE_OVER_4 (256 x 384) (POW-PCDRESOLUTION-BASE-OVER-4)
3 - BASE (512 x 768) (POW-PCDRESOLUTION-BASE)
4 - 4BASE (1024 x 1526) (POW-PCDRESOLUTION-4BASE)
5 - 16BASE (2048 x 3072) (POW-PCDRESOLUTION-16BASE)
The figures in parentheses give the dimensions in pixels.
Note that memory use increases as the resolution increases. If there is
insufficient memory, the image cannot be displayed.
If the ImageName property is set to "Overview.pcd", you should use the
value 0 or 1.
Default value: 2 - BASE_OVER_4 (256 x 384) (POW-PCDRESOLUTION-BASE-OVER-4)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
202 Chapter 4. Properties
PictureString Property
Description: Contains a COBOL picture edit string.
Used in object: RenderText
Value: A COBOL picture edit string.
When the RenderStyle property is "1 - COBOL PICTURE", defines the
COBOL picture string to be used for editing the data.
The CurrencySign and DecimalPointIsComma properties also affect the
data.
PowerCOBOL supports up to 4 decimal digits and up to 14 digits in the
integer part.
The total string length, whose picture is specified by the PictureString
property, must be shorter than 8192 bytes.
See the COBOL Reference Manual for detailed descriptions of COBOL picture
edit strings.
Default value: Container's RenderText property.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Printable Property
Description: Determines whether the control is printed at execution time by the Print
control.
Used in All controls and forms that can be printed at execution time.
controls/objects:
PrintDate Property
Description: Indicates whether the date is printed by the Print control.
Used in control(s): Print
Values (with constants): True - The Print control Prints the date. (POW-TRUE)
False - The Print control does not print the date. (POW-FALSE)
Default value: True - The Print control Prints the date. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
PrinterName Property
Description: Contains the name of the printer to be used.
Used in control(s): Print
Value: The printer name string.
The value is changed if you invoke the SetPrinter or SetPage method and
specify a printer name in the dialog.
Default value: None.
COBOL picture: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
PrintTitle Property
Description: Indicates whether the title text is printed in the page header by the Print
control.
Used in control(s): Print
Values (with constants): True - The Print control prints the title. (POW-TRUE)
False - The Print control does not print the title. (POW-FALSE)
Default value: True - The Print control prints the title. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
204 Chapter 4. Properties
PropertyName Property
Descriptions: Contains the name of the property for which the DataBinding object defines
the data binding properties.
Used in object: DataBinding
Value: Text string containing the name of the property.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Reference only. (The PropertyName is fixed for each DataBinding object,
but you can select which PropertyName/DataBinding object you want to
work with in the DataBinding property page.)
Execution time access: Reference only.
Backward compatibility None.
attributes:
PunchMargin Property
Description: Defines an additional margin to be used for binding.
Used in control(s): Print
Value: The margin width required to allow for binding, expressed in the units
defined in the PaperScaleUnit property.
Default value: 0 inch
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-PUNCHMARGIN PIC S9(9) COMP-5
attribute:
QueryString Property
Description: Contains the character string used as a filter for the items displayed in the
list box part.
Used in control(s): ComboBox
Value: The character string to be used as a filter.
The control only lists items that begin with the character string.
The value is cleared when the CurFieldNo, FileName , FileType or
RecordForm property is changed.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility attribute: POW-STRING PIC X(128)
Chapter 4. Properties 205
RangeSelect Property
Description: Determines whether the slider contains a bar that covers a particular range.
Used in control(s): Slider
Values (with constants): True - Displays a bar that covers the range specified by the SelectStart and
SelectEnd properties. (POW-TRUE)
False - Does not display a bar. (POW-FALSE)
Rate Property
Description: Contains the ratio by which the printed output should be enlarged or
reduced, expressed as a percentage of the original size.
Used in control(s): Print
Values: Enlargement or reduction ratio expressed as a percentage between 50 and
150.
Default value: 100%
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
206 Chapter 4. Properties
ReadOnly Property
Description: Determines whether read only files are displayed in the file list, or whether
text can be input to the TextBox control.
Used in control(s): Edit FileList TextBox
Values:
FileList True - Displays files with the read-only attribute. (POW-TRUE)
False - Does not display files with the read-only attribute. (POW-FALSE)
Edit and True - Text cannot be input. (POW-TRUE)
TextBox False - Text can be input. (POW-FALSE)
When the value is True, you should set the IMEMode property to "0 - None"
or "3 - Disable".
Default value:
FileList False - Does not display files with the read-only attribute. (POW-FALSE)
TextBox False - Text can be input. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-READONLY PIC S9(4) COMP-5
attribute:
Receive Property
Description: Contains the return information from an MCI command.
Used in control(s): MCI
Value: The return information from an MCI command, set by the Command
property.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-MCIRECEIVE PIC X(256)
attribute:
Chapter 4. Properties 207
RecordForm Property
Description: Defines the record format for fixed length text files.
Used in control(s): ComboBox
Value: The format of the record, specified by providing a list of field lengths. Field
lengths can be separated by comma (",") or blank (" ").
For example, to specify a record consisting of two fields of 11 and 8 bytes
respectively code:
MOVE "11, 8" TO "RecordForm"
OF ComboBoxName
It is only effective when the FileType property is "2 - Fixed Text Format".
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-RECORDFORM PIC X(128)
attribute:
Recordset Property
Description: Contains a pointer to the ADO recordset object.
Used in controls: ADODataSource
Used in Objects: None.
Value: A pointer to the ADO recordset object.
Consult the ADO documentation for details about recordset objects.
Notes The following properties of the ADODataSource control can not be set if the
ADO recordset object is created dynamically and set to this property.
CommandType
CursorLocation
CursorType
LockType
And, you must open the recordset by using the Open method of the ADO
recordset object if the recordset is not opened.
Consult the ADO documentation for details about recordset objects.
Default value: None.
COBOL PICTURE: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
208 Chapter 4. Properties
RenderStyle Property
Description: Indicates the manner in which text is converted in the RenderText object.
Used in object: RenderText
Values (with constants): 0 - Standard: (POW-RENDERSTYLE-STANDARD)
Does not convert text.
1 - COBOL PICTURE: (POW-RENDERSTYLE-COBOLPICTURE)
Converts text based on the COBOL picture string defined in the
PictureString property.
2 - Date: (POW-RENDERSTYLE-DATE)
Converts text based on the date string defined in the DateStyle
property.
Default value: 0 - Standard: (POW-RENDERSTYLE-STANDARD)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 209
RenderText Property
Description: Contains a pointer to the RenderText object that determines how the text is
edited.
Used in control(s):
Controls CheckBox Frame OptionButton TextBox
ComboBox ListBox StaticText
CommandButton
Objects Column TableColumn
Value: A pointer to the RenderText object.
The properties of the RenderText object determine how the text contained
in the control or object is displayed at execution time. The RenderText
properties are the RenderStyle, PictureString and DateStyle properties.
For example, if the RenderStyle property is "1 - COBOL PICTURE", the
PictureString property is "$$$,$$$,$$9" and you move "3000" to the Caption
property, PowerCOBOL converts the string and displays "$3,000".
However, if you refer to the Caption property, the string "$3,000" is
converted by PowerCOBOL giving you the value "3000".
ComboBox Applies to the text of items in the list box part.
Column Applies to the Text property of the ListItem object corresponding to the
column.
TableColumn Applies to the Text property of the TableCell object corresponding to the
row.
Default value: None.
COBOL picture: OBJECT REFERENCE POW-COBJECT
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Repeat Property
Description: Determines whether animation repeats from the first frame.
Used in control(s): Animation
Values (with constants): True: Animation repeats. POW-TRUE)
False: Animation does not repeat. (POW-FALSE)
Resource Property
Description: Indicates whether the name specified for an image is a resource name or a
file name.
Used in control(s): Animation CommandButton Image
Values (with constants): True - A resource name (POW-TRUE)
False - A file name (POW-FALSE)
Animation The image name is the name used in the FrameList in the Properties dialog.
CommandButton and The image name is specified in the ImageName property.
Image
Default value:
Animation and Image False - A file name (POW-FALSE)
CommandButton True - A resource name (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
RestoreFocusWhenEnablingForm Property
Description: Determines whether to restore focus when the Enabled property of a form
is changed to True.
Used in control(s): None.
Used in object: Form
Value: True : Focus is restored when the Enabled property of a form is changed to
True. (POW-TRUE)
False: Focus is not restored when the Enabled property of a form is
changed to True. (POW-FALSE)
Default value: True : Focus is restored. (POW-TRUE)
Note : For projects created using V4.0, or converted from V3.0, the default
value is False.
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 211
ReturnWhenEnterKey Property
Description: Determines whether the Return event occurs when the ENTER key is
pressed while editing in the edit box.
Used in control(s): Edit
Value: True : Event occurs. (POW-TRUE)
False: Event does not occur. (POW-FALSE)
Default value: True : Event occurs. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ReturnWhenLostFocus Property
Description: Determines whether the Return event occurs when the edit box loses focus,
and when another control gains focus.
Used in control(s): Edit
Value: True : Event occurs. (POW-TRUE)
False: Event does not occur. (POW-FALSE)
Default value: False: Event does not occur. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
212 Chapter 4. Properties
ReturnWhenMaxText Property
Description: Determines whether the Return event occurs when the text string reaches
the length that is defined in the MaxLength property.
Used in control(s): Edit
Value: True : Event occurs. (POW-TRUE)
False: Event does not occur. (POW-FALSE)
Default value: True : Event occurs. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
RightMargin Property
Description: Defines the width of the right margin when the form is printed.
Used in control(s): Print
Value: The width of the right margin in the units defined by the PaperScaleUnit
property.
Default value: 0.6 inch
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-RIGHTMARGIN PIC S9(9) COMP-5
attribute:
Chapter 4. Properties 213
Row Property
Description: Contains the row number of the cell that has focus in the Table control.
Used in control(s): Table
Value: The line number of the cell that has the focus. Only cells in TableColumn
objects, with the Writable property set to True, can have focus.
Default value: Row number of the most significant editable cell (i.e. the cell closest to the
top left corner) whose Writable property is True.
Undefined if there are cells whose Writable property is True.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility POW-ROW PIC S9(9) COMP-5
attribute:
RowCaption Property
Description: Indicates whether to display row headings.
Used in control(s): Table
Values (with constants): True - Displays row headings. (POW-TRUE)
False - Does not display row headings. (POW-FALSE)
Default value: True - Displays row headings. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility attribute: POW-ROWCAPTION PIC S9(4) COMP-5
214 Chapter 4. Properties
RowCount Property
Description: Contains the number of rows in the table.
Used in control(s): Table
Values: The number of rows in the table.
The maximum value is 2000.
Default value: 3
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-ROWS PIC S9(4) COMP-5
attribute:
Scalable Property
Description: Indicates whether the size, position and/or font size of controls on a form
are changed proportionately when the size of the form is changed.
Used in object: Form
Values (with constants): True : Changes the size, position and/or font size of controls.
(POW-TRUE)
False: Does not change size, position or font size of controls.
(POW-FALSE)
The ScalingStyle property of each control on the form determines which of
the size, position and font size properties are affected when the form is
resized.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 215
Scale Property
Description: Defines the interval between the graduation marks on the bar chart axis.
Used in control(s): Graph
Value: The interval between graduation marks.
When the value is 0, the graduation marks are not displayed.
It is not effective when the GraphStyle property is "3 - Pie".
The value must be less than or equal to the greater of the absolute value of
the Lower property and the absolute value of the Upper property.
For example, when the value of the Lower property is -50 and the value of
the Upper property is 100, the maximum value is 100.
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ScaleMode Property
Description: Defines the units to be used for the coordinates of the control or form.
Used in control(s): All controls and forms.
Values (with constants): 0 - Pixel (POW-SCALEPIXELS)
1 - 1/100 mm (POW-SCALEHIMETRIC)
2 - 1/1000 inch (POW-SCALEHIENGLISH)
3 - 1/20 Point (POW-SCALETWIPS)
Default value:
Form 3 - 1/20 Point (POW-SCALETWIPS)
Others Container's ScaleMode.
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access:
DBAccess, DDE, Not accessible.
ExcelConnection,
Timer, Print
Others Set and reference.
Backward compatibility None.
attribute:
216 Chapter 4. Properties
ScalingStyle Property
Description: Indicates which attributes of the control to change when the containing
Form object is resized.
Used in controls: Animation FileList ListBox Slider
CheckBox FolderList ListView StaticText
ComboBox Frame MCI Tab
CommandButton Graph OptionButton Table
Custom GroupBox ProgressIndicator TextBox
DriveList Image ScrollBar Toolbar
Edit Label Shape Treeview
Values (with constants): 0 - None (POW-SCALING-NONE)
1 - Resize only (POW-SCALING-SIZE)
2 - Reposition only (POW-SCALING-POSITION)
3 - Resize and reposition (POW-SCALING-SIZEPOSITION)
5 - Resize and resize font (POW-SCALING-SIZEFONT)
7 - Resize, reposition and resize fon (POW-SCALING-SIZEPOSITIONFONT)
It is only effective when the Scalable property of the containing Form object
is set to True.
Note:
(i) You should use true type fonts if you choose to resize the font. If you do
not use true type fonts, the control may not be drawn accurately.
(ii) You cannot change the size (Width property) of the TableColumn or
Column object if the form size is changed.
Default value: 7 - Resize, reposition and resize font (POW-SCALING-SIZEPOSITIONFONT)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 217
ScrollLock Property
Description: Determines whether the column scrolls.
When the size of the table is too small to display all the columns,
PowerCOBOL displays a horizontal scroll bar. This property determines
whether the column can be scrolled out of view or remains in a fixed
position.
Used in object: TableColumn
Values (with constants): True - Does not scroll the column. (POW-TRUE)
False - Scrolls the column. (POW-FALSE)
You can lock scrolling for consecutive columns.
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ScrollPage Property
Description: Defines the size of a scroll bar "page".
Used in control(s): ScrollBar
Value: Zero or a positive integer.
The amount the Value is incremented by each time the scroll bar is "paged"
(e.g. by clicking in the lift shaft areas).
The value should satisfy the following relationship:
Min <= Max - (ScrollPage - 1)
When the value is greater than zero the size of the scroll box is changed.
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
218 Chapter 4. Properties
Selected Property
Description: Indicates whether an object is selected.
Used in object(s): ListItem Node
Values (with constants): True - The object is selected. (POW-TRUE)
False - The object is not selected. (POW-FALSE)
Default value: False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
SelectedImageIndex Property
Description: Contains the index into the image list when a Node object is selected.
Used in control(s): Node
Value: An integer greater than zero.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
SelectEnd Property
Description: Defines the ending value of the selected range within the Slider control.
Used in control(s): Slider
Value: Zero or a positive integer.
The value should satisfy the following relationships:
SelectStart <= SelectEnd
and
SelectEnd <= Max
It is only effective when the RangeSelect property is True.
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 219
SelectStart Property
Description: Defines the starting value of the selected range within the Slider control.
Used in control(s): Slider
Value: Zero or a positive integer.
The value should satisfy the following relationships:
SelectStart <= SelectEnd
and
SelectStart >= Min
It is only effective when the RangeSelect property is True.
Default value: 0
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
SelectText Property
Description: Determines whether text in the control is selected when it gains editing
focus.
Used in control(s): Edit Table TextBox
Values (with constants): True - Text is selected. (POW-TRUE)
False - Text is not selected. (POW-FALSE)
Table Determines whether text is selected when the table cell enters the edit
state.
TextBox If the EditableLabel property is False, determines whether text is selected
when the control receives focus.
If the EditableLabel property is True, determines whether text is selected
when the user starts editing the text.
It is only effective when the MultiLine property is False.
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access:
Table Set and reference.
TextBox Reference only.
Backward compatibility None.
attribute:
220 Chapter 4. Properties
SelItem Property
Description: Contains a pointer to the selected ListItem object.
Used in control(s): ListView
Value: A pointer to the ListItem object.
It is only effective when the MultiLine property is False.
Default value: None.
COBOL picture: OBJECT REFERENCE POW-CLISTITEM
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 221
SelItemIndex Property
Description: Contains the index of the selected ListItem object.
Used in control(s): ListView
Value: The index of the selected ListItem object.
The value is an integer from 1 to Count property.
It is only effective when the MultiLine property is False.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
SelNode Property
Description: Contains a pointer to the selected Node object.
Used in control(s): TreeView
Value: A pointer to the node object.
Default value: None.
COBOL picture: OBJECT REFERENCE POW-CNODE
OLE data type: VT_DISPATCH
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
222 Chapter 4. Properties
SelString Property
Description: Contains the character string of the selected item or a string representing
the selected item.
Used in control(s): ComboBox FileList ListBox
DriveList FolderList
Value: The character string of the selected item.
FileList, ListBox The character string that has focus when the MultiSelect property is "1 -
Multiple" or "2 - Extended select ".
FolderList The relative path from the current folder to the selected folder. For
example:
- If the current folder is selected the value is "." (period).
- If the parent of the current folder is selected the value is "..\".
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility POW-SELSTRING PIC X(64)
attribute:
ComboBox, ListBox POW-SELSTRING256 PIC X(256)
ShapeStyle Property
Description: Defines the style of the shape for the Shape control.
Used in control(s): Shape
Values (with constants): 0 - Rectangle (POW-SHAPESTYLE-RECTANGLE)
1 - Square (POW-SHAPESTYLE-SQUARE)
2 - Circle (POW-SHAPESTYLE-CIRCLE)
3 - Oval (POW-SHAPESTYLE-ELLIPSE)
Default value: 0 - Rectangle (POW-SHAPESTYLE-RECTANGLE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 223
ShowExcel Property
Description: Determines whether the Excel application is displayed.
Used in control(s): ExcelConnection
Values (with constants): True - Displays the Excel application. (POW-TRUE)
False - Does not display the Excel application. (POW-FALSE)
If there is more than one ExcelConnection control on the form,
PowerCOBOL uses the ShowExcel value of the control that is last in the
control order.
Default value: True - Displays the Excel application. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ShowStatusbar Property
Description: Determines whether the form includes a status bar.
Used in object: Form
Values (with constants): True: Form includes a status bar. (POW-TRUE)
False: Form does not include a status bar. (POW-FALSE)
Default value: False: Form does not include a status bar. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
224 Chapter 4. Properties
ShowToolTips Property
Description: Determines whether the ToolTipText is displayed for the Button objects of
the tool bar.
Note that ShowToolTips does not affect the display of the ToolTipText
property in the Toolbar control.
Used in control: Toolbar
Values (with constants): True - Displays the tool tip text. (POW-TRUE)
False - Does not display the tool tip text. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Size Property
Description: Defines the size of the font.
Used in object: Font
Value: The size of the font expressed in points. One point is 1/72 inches.
Default value: Container's Size property.
COBOL picture: S9(14)V9(4)
OLE data type: VT_CY
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-FONTSIZE PIC S9(4) COMP-5
attribute:
SmallIconIndex Property
Description: Contains the index of the small icon image list when small icons are being
used in the ListItem object.
Used in control(s): ListItem
Value: The index for the small icon image list.
The value is an integer greater than 0.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 225
SmallIcons Property
Description: Contains the name of the resource that contains the small icon images
when small icons are being used in the ListItem objects of the ListView
control.
Used in control(s): ListView
Value: The name of the resource that contains the small icon images.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
SmallStep Property
Description: Defines the amount of a small step movement in a scroll bar or slider.
Used in control(s): ScrollBar Slider
Values:
ScrollBar -65535 to 65535
The "small step" is the amount of movement when the mouse is clicked on
the arrow buttons, or when the arrow keys are pressed.
Slider 0 to 65535
The "small step" is the amount of movement when the arrow keys are
pressed.
Default value: 10
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility
attribute:
ScrollBar POW-SMALLSTEP PIC S9(9) COMP-5
226 Chapter 4. Properties
Smooth Property
Description: Determines whether the progress indicator grows continuously or in discrete
steps.
Used in control(s): ProgressIndicator
Values (with constants): True - Grows smoothly. (POW-TRUE)
False - Grows in steps. (POW-FALSE)
When the value is False, the size of each step is the value defined in the
Step property.
Default value: False - Grows in steps. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
SortColumn Property
Description: Contains the index of the column that is used to sort the ListItem objects.
Used in control(s): ListView
Value: The index of the column to sort.
The value is an integer from 1 to the ColumnCount property.
The Text property corresponding to the column is used as the key for the
sort.
Default value: 1
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 227
Sorted Property
Description: Determines whether to sort list items.
Used in control(s): ComboBox ListBox TreeView
Values (with constants): True - Sort items. (POW-TRUE)
False - Do not sort items. (POW-FALSE)
ComboBox and ListBox Sorts the items in the list box part.
Note: Items inserted by the InsertString method are not sorted
automatically. The items are inserted at the position specified by the
InsertIndex parameter. Use the AddString method if you want to sort the
items.
TreeView Sorts the Node objects.
Default value: False - Do not sort items. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access:
ComboBox and ListBox Reference only.
TreeView Set and reference.
Backward compatibility None.
attribute:
SortKind Property
Description: Determines whether ListItem objects are sorted in text or numerical order.
Used in control(s): ListView
Values (with constants): 0 - Text (POW-SORTKIND-TEXT)
1 - Numeric (POW-SORTKIND-NUMERIC)
For example, assume that there are three ListItem objects and their Text
properties are set to "1", "2", and "10":
If the value is "0 - Text", the ascending order is "1", "10", "2". If the value
is "1 - Numeric", the ascending order is "1", "2", "10".
Note that:
• The objects are not sorted immediately after this value is changed,
however the objects are sorted after the value of the SortOrder
property is changed.
• If the value is "1 - Numeric" the sort order is determined by using
equivalent VT_CY values. If a numeric value cannot be converted to a
VT_CY value, (see "Appendix C. Data Types" for supported range) the
ListItem object is not sorted and the position is undefined.
Default value: 0 – Text
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility attribute: None.
228 Chapter 4. Properties
SortOrder Property
Description: Defines the sort order for the ListItem objects.
Used in control(s): ListView
Values (with constants): 0 - None (POW-SORTORDER-NONE)
1 - Ascending (POW-SORTORDER-ASC)
2 - Descending (POW-SORTORDER-DESC)
The objects are resorted as soon as the value is changed.
Default value: 0 - None (POW-SORTORDER-NONE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Source Property
Description: Indicates the paper source to be used on the printer.
Used in object: Print
Values (with constants): 0 - Default: (POW-PRINTSOURCE-DEFAULT)
The default setting of the printer.
Values other than 0: Source defined by the printer.
Each printer has different printer source options. If you want to use a paper
source other than the default, refer to your printer's documentation for the
other values to set.
If in doubt you should set the value to 0.
Default value: 0 - Default: (POW-PRINTSOURCE-DEFAULT)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 229
StartUpPosition Property
Description: Defines the initial position for the form window.
Used in object: Form
Values (with constants): 0 - Auto: (POW-STARTUPPOS-AUTO)
PowerCOBOL determines the position based on the position of the
window at design time.
1 - Center Owner: (POW-STARTUPPOS-CENTEROWN)
When you open the form using the OpenForm method or CallForm2
(CallForm) method, PowerCOBOL centers the form in the parent
window. If the form is opened by any other means it is centered on the
screen.
2 - Center Screen: (POW-STARTUPPOS-CENTERSCR)
PowerCOBOL centers the form on the screen, excluding the task bar.
3 - Windows Default: (POW-STARTUPPOS-DEFAULT)
The Windows system default position.
4 - Manual: (POW-STARTUPPOS-MANUAL)
PowerCOBOL positions the form using the values specified in the Top
and Left properties.
Default value: 0 - Auto: (POW-STARTUPPOS-AUTO)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
StatusText Property
Description: Defines the text to display in the status bar.
Used in object: Form
Value: The character string to display.
It is only effective when the ShowStatusbar property is True.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
230 Chapter 4. Properties
Step Property
Description: The Step property defines the amount to increase the Value property using
the ProgressStep method - these are the steps by which the progress
indicator bar grows.
Used in control(s): ProgressIndicator
Values (with constants): The size of the steps.
The value is an integer greater than zero.
The value should satisfy the following relationship:
Step < Max - Min
Default value: 10
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Strikethrough Property
Description: Indicates whether the text has the strikethrough (deletion) line.
Used in object: Font
Values (with constants): True - Has strikethrough. (POW-TRUE)
False - Does not have strikethrough. (POW-FALSE)
Default value: Container's Strikethrough property
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-STRIKE PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 231
Style Property
Description: Defines the style of the control
Used in control(s): ComboBox Tab Toolbar
Used in object: Button
Values (with constants):
ComboBox 0 - Simple: (POW-COMBO-STYLE-SIMPLE)
A combination of a text box and a list box. Always displays the list box.
1 - DropDown: (POW-COMBO-STYLE-DROPDOWN)
A combination of a text box and a list box. Displays a down-arrow
button that displays the list when clicked, or the user can enter text into
the text box.
2 - DropDownList: (POW-COMBO-STYLE-DROPDOWNLIST)
A combination of a static text control and a list box. Displays a down-
arrow button that displays the list when clicked. The user cannot filter
the contents of the list box.
Tab 0 - Tabs: (POW-TAB-STYLE-TABS)
Pages are selected using file tabs.
1 - Buttons: (POW-TAB-STYLE-BUTTONS)
Pages are selected using "latching" buttons.
Toolbar 0 - Normal: (POW-TBAR-STYLE-NORMAL)
Made up of buttons in the 3D style.
1 - Flat: (POW-TBAR-STYLE-FLAT)
Made up of flat buttons with Caption text displayed below the buttons.
2 - FlatList: (POW-TBAR-STYLE-FLATLIST)
Made up of flat buttons Caption text displayed at the side of the image.
Button 0 - Normal: (POW-TBAR-BTN-STYLE-NORMAL)
Normal push button.
1 - Separator: (POW-TBAR-BTN-STYLE-SEPARATOR)
The separator between buttons. The ButtonClick event is not generated
if you click it.
2 - CheckButton: (POW-TBAR-BTN-STYLE-CHECK)
A "latching" button - i.e. a button that stays depressed or raised until
clicked again. Used for indicating that an option is selected or not
selected.
3 - CheckButtonGroup: (POW-TBAR-BTN-STYLE-CHECKGROUP)
A group of connected "latching" buttons. Only one button in the group
can be selected at a time. The selected button remains in the selected
state until another button in the group is depressed.
A group consists of all adjacent buttons whose Style property is "3 -
CheckButtonGroup".
The ButtonClick event is not generated when you click the mouse on a
button that is already selected.
4 - DropDownButton: (POW-TBAR-BTN-STYLE-DROPDOWN)
A button with an arrow. When the arrow button is clicked a DropDown
event is generated. You can use this event to show a pop-up menu
using the PopupMenu method.
Default value:
ComboBox 2 - DropDownList: (POW-COMBO-STYLE-DROPDOWNLIST)
Tab 0 - Tabs: (POW-TAB-STYLE-TABS)
232 Chapter 4. Properties
System Property
Description: Indicates whether the file list displays files with the system attribute.
Used in control(s): FileList
Values (with constants): True - Displays files with the system attribute. (POW-TRUE)
False - Does not display files with the system attribute. (POW-FALSE)
Default value: False - Does not display files with the system attribute. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-SYSEM PIC S9(4) COMP-5
attribute:
TabFixedHeight Property
Description: Defines the height of the tab.
Used in control: Tab
Value: The height of the tab expressed in the units defined in the ScaleMode
property.
It is only effective when the TabWidthStyle property is "1 - Fixed".
Default value: None.
COBOL picture S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 233
TabFixedWidth Property
Description: Defines the width of the tab.
Used in control: Tab
Value: The width of the tab expressed in the units defined in the ScaleMode
property.
It is only effective when the TabWidthStyle property is "1 - Fixed".
Default value: None.
COBOL picture S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
TabGroup Property
Description: Indicates whether the control is the first control in a tab group.
Used in control(s): CheckBox FileList ListView Table
ComboBox FolderList OptionButton TextBox
CommandButton Frame Scrollbar Toolbar
Custom GroupBox Slider TreeView
DriveList Label StaticText
Edit ListBox Tab
Values (with constants): True - The first control. (POW-TRUE)
False - Not the first control. (POW-FALSE)
A tab group is a group of controls in which input focus can be moved by
using the arrow keys. Each control that can gain focus has a unique number
defined in the TabIndex property (if you enter the numbers PowerCOBOL
ensures that no other control has that number). A tab group starts with the
first control that has the TabGroup property set to True, and contains all the
controls with higher numbers up to (but not including) the next control with
the TabGroup property set to True.
The TabStop property determines whether focus can be gained by the
control by use of the tab key. It operates independently of the TabGroup
property.
Default value:
GroupBox, StaticText and True (POW-TRUE)
Tab
Others False (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
234 Chapter 4. Properties
TabIndex Property
Description: Defines the order in which focus moves from control to control when using
the tab or arrow keys.
Used in control(s): CheckBox FileList ListView Table
ComboBox FolderList OptionButton TextBox
CommandButton Frame Scrollbar Toolbar
Custom GroupBox Slider TreeView
DriveList Label StaticText
Edit ListBox Tab
Value: The value is an integer greater than zero.
When the tab key is pressed focus moves between controls that can receive
focus and have TabStop set to True. The focus moves from one control to
the control with the next highest TabIndex value.
Back Tab (Shift + Tab) works in the reverse order.
If TabGroup properties are defined focus can be moved, within tab groups,
by the arrow keys, following the TabIndex order.
Tab groups can be particularly useful for sets of option buttons.
Although TabIndex can be set for the GroupBox, StaticText and Toolbar
controls, which cannot receive focus at execution time, they are skipped
when the focus is being moved by the tab key.
Default value: Assigned by PowerCOBOL using the first unassigned number.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 235
TabStop Property
Description: Indicates whether the control receives focus when focus is being moved
using the tab key.
Used in control(s): CheckBox Edit OptionButton Table
ComboBox FileList ScrollBar TextBox
CommandButton FolderList Slider TreeView
Custom ListBox Tab
DriveList ListView
Values (with constants): True - Receives focus when focus is moved. (POW-TRUE)
False - Does not receive focus when focus is moved. (POW-FALSE)
Default value: True - Receives focus when focus is moved. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
TabWidthStyle Property
Description: Determines whether the tabs are sized to fit the PageCaption text or are
fixed width.
Used in control: Tab
Values (with constants): 0 - Normal: (POW-TAB-STYLE-NORMAL)
The size is adjusted automatically using the size of the page caption
text.
1 - Fixed: (POW-TAB-STYLE-FIXED)
The size is specified in the TabFixedWidth and TabFixedHeight
properties.
Default value: 0 - Normal: (POW-TAB-STYLE-NORMAL)
COBOL picture S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 237
TargetName Property
Description: Contains the table, view or procedure name being accessed.
Used in control(s): DBAccess
Value: The table, view, or procedure name.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility POW-DBTABLENAME PIC X(260)
attribute:
TargetType Property
Description: Defines the kind of data to be extracted.
Used in control(s): DBAccess
Values (with constants): 0 - Table/View (POW-TARGETYPE-TABLE)
1 - Procedure (POW-TARGETYPE-PROCEDURE)
Default value: 0 - Table/View (POW-TARGETYPE-TABLE)
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
238 Chapter 4. Properties
Text Property
Description: Contains the text character string associated with the control or object
Used in:
Controls ComboBox Edit TextBox
Objects Node TableCell
Value: The text character string displayed or input.
The values that you can set depend on the definitions in the RenderText
object.
ComboBox The character string in the static text or text box part.
TextBox The character string in the text box.
Node The character string in a Node of the TreeView control.
TableCell The character string for a column heading of the Table control.
Default value:
TextBox Same as Name property.
Others None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access:
TextBox Set and reference.
Others Not accessible.
Execution time access: Set and reference.
ComboBox Note that, when the Style property is
"2 - DropDownList", it is reference only.
Backward compatibility
attribute:
ComboBox POW-TEXT PIC X(256)
TextBox 1. POW-TEXT PIC X(256)
2. POW-MULTITEXT PIC X(4096)
3. POW-MULTITEXT8 PIC X(8192)
4. POW-NUMERIC PIC S9(14)V9(4)
Chapter 4. Properties 239
TextCase Property
Description: Indicates whether the case of characters entered should be converted to
upper, lower or left as entered.
Used in control(s): TextBox
Values (with constants): 0 - Normal: No conversion. (POW-TEXTCASE-NORMAL)
1 - UpperCase: Converts all characters to upper case.
(POW-TEXTCASE-UPPERCASE)
2 - LowerCase: Converts all characters to lower case.
(POW-TEXTCASE-LOWERCASE)
Default value: 0 - Normal: No conversion. (POW-TEXTCASE-NORMAL)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
ThreeStates Property
Description: Indicates whether the check box can take three states, rather than two
states.
Used in control(s): CheckBox
Values (with constants): True - Takes three states. (POW-TRUE)
False - Takes two states. (POW-FALSE)
When the value is True, the control takes three states -
selected (black checkmark),
unselected (no checkmark) and
undefined (grayed checkmark).
The third state (grayed checkmark) is used to indicate partial selection of a
group of options, or other in between states.
Default value: False - Takes two states. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 241
ThumbVisible Property
Description: Determines whether the sliding pointer ("thumb") is visible.
Used in control(s): Slider
Values (with constants): True - Displays the thumb. (POW-TRUE)
False - Does not display the thumb. (POW-FALSE)
Default value: True - Displays the thumb. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
TickCount Property
Description: Contains the number of graduation marks ("ticks") displayed.
Used in control(s): Slider
Value: The number of ticks.
The value is an integer greater than zero.
The value includes the marks at the Min and Max property points.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
242 Chapter 4. Properties
TickFrequency Property
Description: Defines the increments between graduation marks ("ticks") on the slider.
Used in control(s): Slider
Value: The increments between ticks.
The value is an integer greater than zero.
It is only effective when the AutoTick property is True.
The value should satisfy the following relationship:
TickFrequency < Max – Min
Default value: 10
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
TickStyle Property
Description: Defines the manner in which the graduation marks ("ticks") are displayed
Used in control(s): Slider
Values (with constants): 0 - No Ticks (POW-TICKSTYLE-NOTICKS)
1 - Bottom / Right (POW-TICKSTYLE-BOTTOMRIGHT)
2 - Top / Left (POW-TICKSTYLE-TOPLEFT)
3 - Both (POW-TICKSTYLE-BOTH)
Apart from value 3, the sliding pointer points towards the ticks.
Default value: 1 - Bottom / Right (POW-TICKSTYLE-BOTTOMRIGHT)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
244 Chapter 4. Properties
TimeFormat Property
Description: Defines the time units used in the MCI control. This affects the
MediaPosition and MediaLength properties.
Used in control(s): MCI
Values (with constants): 0 - Millisecond (POW-MCIFORMATMILLISECONDS)
2 - Minute/second/frame (POW-MCIFORMATMSF)
3 - Frame (POW-MCIFORMATFRAMES)
10 - Track/minute/second/frame (POW-MCIFORMATTMSF)
The value is undefined until the MCI driver is open.
Specifiable values vary between MCI drivers.
When TimeFormat is 0 or 3, the times are held as four byte quantities
defining the number of milliseconds or frames.
When TimeFormat is 2, the data is stored in the lower three bytes:
Lowest order byte: Minutes
2nd lowest order byte: Seconds
3rd lowest order byte: Frames
When TimeFormat is 10, the data is stored in the four bytes:
Lowest order byte: Tracks
2nd lower order byte: Minutes
3rd lower order byte: Seconds
4th lower order byte: Frames
See the MediaLength Sample Code for an example of how to extract the
track, minute, second and frame information.
Note:
For Intel 80x86 CPU platforms (the usual platform for Windows) low-high
ordering of bytes is reversed compared to normal COBOL byte ordering.
Using COMP-5 normally takes care of this for you, but you need to be aware
of the reverse byte order when unpicking multiple bytes as in the above
sample.
Default value: None.
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility POW-MCITIMEFORMAT PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 245
TitleBar Property
Description: Determines whether the form displays a title bar.
Used in object: Form
Values (with constants): True - Displays a title bar. (POW-TRUE)
False - Does not display a title bar. (POW-FALSE)
Default value: True (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
ToolboxBitmap Property
Description: Contains the name of the image to use in the toolbox if you register the
form as an ActiveX control and add the ActiveX as a custom control to a
toolbox (such as the toolboxes in PowerCOBOL or Visual Basic).
Used in control: Form
Value: A Resource name corresponded to a bitmap file.
The size of the bitmap should be 16x15 pixels.
You should register the ActiveX to the system before you add the ActiveX
control to the toolbox.
Default value: None.
COBOL picture X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
246 Chapter 4. Properties
TooltipText Property
Description: Contains the tool tip text for the control or object.
A tool tip is a brief description of the object, displayed when the mouse
pointer hovers over the object.
Tab Contains the tooltip text for the currently selected tab page.
Used in controls: Animation FileList ListView StaticText
CheckBox FolderList MCI Tab
ComboBox Frame OptionButton Table
CommandButton Graph ProgressIndicator TextBox
Custom GroupBox ScrollBar Toolbar
DriveList Image Shape TreeView
Edit ListBox Slider
Used in objects: Button
Value: The tooltip text.
Default value: None.
COBOL picture X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 247
Top Property
Description: Contains the Y coordinate of the upper left corner of the control.
Used in control(s): All controls and the Form object
Value: The Y coordinate expressed in the units defined in the ScaleMode property.
Controls Relative to the upper left corner of the Form or control, which is identified in
the Container property.
Form Relative to the upper left corner of the screen.
You can only set the value when the StartUpPosition property is "4 –
Manual".
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access:
Toolbar Set and reference.
You can only set the value when the Align property is "0 - None".
Others Set and reference.
Execution time access:
DBAccess, DDE, Not accessible.
ExcelConnection, Timer and
Print
Toolbar Set and reference.
You can only set the value when the Align property is "0 - None".
Others Set and reference.
Backward compatibility POW-POSITION - made up of the following elements.
attribute: This property corresponds to POS-Y.
01 POSITIONS.
02 POS-X PIC S9(4) COMP-5.
02 POS-Y PIC S9(4) COMP-5.
02 POS-WIDTH PIC S9(4) COMP-5.
02 POS-HEIGHT PIC S9(4) COMP-5.
TopMargin Property
Description: Defines the width of the top margin when the form is printed.
Used in control(s): Print
Value: The width of the margin at the top of the page in the units defined by the
PaperScaleUnit property.
Default value: 0.6 inch
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-UPMARGIN PIC S9(9) COMP-5
attribute:
248 Chapter 4. Properties
Topmost Property
Description: Indicates that the form is taken to the top of the Z order (the order in which
windows are layered on the screen) and is kept there.
Used in object: Form
Values (with constants): True - Takes the form to the top of the Z order and keeps it there.
(POW-TRUE)
False - The form is not kept at the top of the Z order. (POW-FALSE)
When the value is True, the form is not hidden behind another window even
if the form loses focus.
Default value: False - The form is not kept at the top of the Z order. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
TotalCount Property
Description: Contains the total number of all Node objects in the TreeView control.
Used in control(s): TreeView
Value: The number of Node objects.
The value is an integer greater than 0.
Default value: None.
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Not accessible.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Chapter 4. Properties 249
TVLineStyle Property
Description: Defines how lines are displayed between the Node objects in the TreeView
control.
Used in control(s): TreeView
Values (with constants): 0 - TreeLines: (POW-TVLINESTYLE-TREELINES)
Displays lines from parent to child and between sibling nodes.
1 - RootLines: (POW-TVLINESTYLE-ROOTLINES)
As for style 0, but also with lines connecting root nodes.
Default value: 0 - TreeLines: (POW-TVLINESTYLE-TREELINES)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
TVStyle Property
Description: Determines which elements of the Node objects are displayed in the
TreeView control.
Used in control(s): TreeView
Values (with constants): 0 - Text Only (POW-TVSTYLE-TEXTONLY)
1 - Image and Text (POW-TVSTYLE-IMAGE)
2 - Plus / Minus and Text (POW-TVSTYLE-PLUSMINUS)
3 - Plus / Minus, Image and Text (POW-TVSTYLE-PLUSMINUSIMAGE)
4 - TreeLines and Text (POW-TVSTYLE-LINE)
5 - TreeLines, Image and Text (POW-TVSTYLE-LINEIMAGE)
6 - TreeLines, Plus / Minus and Text (POW-TVSTYLE-LINEPLUSMINUS)
7 - TreeLines, Plus / Minus, Image and Text
(POW-TVSTYLE-LINEPLUSMINUS)
Default value: 5 - TreeLines, Image and Text (POW-TVSTYLE-LINEIMAGE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
250 Chapter 4. Properties
UnacceptableDefault Property
Description: Indicates whether the control can become the default button.
Used in object: CommandButton
Values (with constants): True - Cannot become the default button. (POW-TRUE)
False - Can become the default button. (POW-FALSE)
When the value is True, the Click event is not generated when the ENTER
key is pressed, even if the control has focus. And the Default property is
always False (cannot be set to True).
This property is used when you allocate a function key to the
CommandButton. You can select whether the CommandButton accepts or
rejects the Click event when you press the ENTER key.
Default value: False - Can become the default button. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Underline Property
Description: Determines whether the text is underlined.
Used in object: Font
Values (with constants): True - Text is underlined. (POW-TRUE)
False - Text is not underlined. (POW-FALSE)
Default value: Container's UnderLine property.
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-UNDERLINE PIC S9(4) COMP-5
attribute:
Chapter 4. Properties 251
Upper Property
Description: Defines the upper limit of the range of data shown on the graph.
Used in control(s): Graph
Value: The upper limit of the range of data
It is not effective when the GraphStyle property is "3 - Pie".
Default value: 100
COBOL picture: S9(9) COMP-5
OLE data type: VT_I4
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-UPPER PIC S9(9) COMP-5
attribute:
UseCaption Property
Description: Indicates whether to display the value of the Caption property in the
control.
Used in control(s): GroupBox
Values (with constants): True: Displays the caption. (POW-TRUE)
False: Does not display the caption. (POW-FALSE)
Default value: True: Displays the caption. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
UseControlWindow Property
Description: Indicates whether the MCI control window is displayed when the media is
played.
Used in control(s): MCI
Values (with constants): True: Displays control window. (POW-TRUE)
False: Does not display the control window. (POW-FALSE)
Default value: False: Does not display the control window. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
252 Chapter 4. Properties
UseDefaultDate Property
Description: Indicates whether to display the current system date when the input to a
RenderText date style item is blank.
Used in object: RenderText
Values (with constants): True - Displays the current system date, formatted to the RenderText
specification, when the corresponding text field is empty.
(POW-TRUE)
False - Displays spaces when the corresponding text field is empty.
(POW-FALSE)
It is only effective when the RenderStyle property is "2 - Date".
When the value is False, you should ensure a value is set in "YYYYMMDD"
format.
Default value: True - Displays the current system date, formatted to the RenderText
specification, when the corresponding text field is empty.
(POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
UseMnemonic Property
Description: Determines whether to use the '&' character in the Caption property to
indicate that the following character is the mnemonic character.
It is used to read strings in databases that include the '&' character.
Used in control(s): Label StaticText
Value: True : Uses the '&' character to indicate the mnemonic key.
(POW-TRUE)
False: Does not use the '&' character to indicate the mnemonic key.
(POW-FALSE)
The character '&' is displayed in the caption string when the value is False.
When the value is true, the character immediately following the '&' in the
caption string is underlined.
Note that, if you put "&&" in the caption, it is taken as a single '&'
character, not underlined.
Default value: True: Use the '&' character as the mnemonic key. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 253
UsePalette Property
Description: Indicates whether to use a logical palette for animation bitmaps.
Used in control(s): Animation
Values (with constants): True - Uses a logical palette. (POW-TRUE)
False - Does not use a logical palette. (POW-FALSE)
When the value is True, PowerCOBOL uses a logical palette and displays the
images with approximate colors.
However, the images are not dithered. So if the image contains more colors
than the system setting, the image may not be displayed with the correct
colors.
When set to True drawing the image takes more time than when set to
False.
Default value: False - Does not use a logical palette. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
UserID Property
Description: Contains the user ID of the person accessing the database.
Used in control(s): DBAccess
Value: The user ID.
Default value: None.
COBOL picture: X, up to 8192 bytes
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-DBUSERID PIC X(32)
attribute:
254 Chapter 4. Properties
UserName Property
Description: Contains the user name or ID to connect to the database.
Used in controls: ADODataSource
Used in Objects: None.
Value: The user name or ID.
Default value: None.
COBOL PICTURE: X, up to 8192 bytes.
OLE data type: VT_BSTR
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attributes:
UseSystemColor Property
Description: Indicates whether to use the system colors.
Used in control(s): CommandButton Toolbar
Values (with constants): True: Uses the system colors. (POW-TRUE)
False: Does not use the system colors. (POW-FALSE)
When the value of this property is False, the "Button Face" color is mapped
to the color of the BackColor property, the "Button Text" color is mapped to
the color of the ForeColor property, and the color of the text's background
is mapped to the HilightColor property.
Default value: True: Uses the system colors. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 255
Value Property
Description: Contains a value associated with the control.
Used in:
Controls CheckBox ProgressIndicator ScrollBar
OptionButton Slider
Object Button
Values (with constants):
CheckBox 0 - Unchecked (POW-TRISTATE-UNCHECKED)
1 - Checked (POW-TRISTATE-CHECKED)
2 - Grayed (POW-TRISTATE-GRAY)
The value of 2 is only effective when the ThreeStates property is True.
OptionButton True: Selected (POW-TRUE)
False: Not selected. (POW-FALSE)
ProgressIndicator Value indicating the progress.
The value should satisfy the following relationships:
Min property <= value
and
Max property >= value
Slider Value indicating the present position.
The value should satisfy the following relationships:
Min property <= value
and
Max property >= value
ScrollBar Value indicating the position of the scroll box.
The value should satisfy the following relationships:
-32768 <= value <= 32767
and
Min property <= value
and
Max property >= value
and
value <= Max property - (ScrollPage property - 1)
If you change the value of the Max or Min property and the above
relationship is not satisfied, PowerCOBOL automatically resets the value to
the closest valid value.
Button True - Selected. (POW-TRUE)
False - Not selected. (POW-FALSE)
It is only effective when the Style property is
"2 – CheckButton" or "3 - CheckButtonGroup".
If the value becomes True, the button is changed to the image contained in
the HotImageList .
If no HotImageList is specified, the image specified in the ImageList is used.
Default values:
CheckBox 0 - Unchecked (POW-TRISTATE-UNCHECKED)
OptionButton False: Not selected. (POW-FALSE)
ProgressIndicator Value of the Min property
Slider 0
256 Chapter 4. Properties
ScrollBar 0
Button False - Not selected. (POW-FALSE)
Data type:
CheckBox COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
OptionButton and Button COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
ProgressIndicator, Slider, COBOL picture: S9(9) COMP-5
ScrollBar OLE data type: VT_I4
Design time access:
ProgressIndicator Not accessible.
Others Set and reference.
Execution time access: Set and reference.
Backward compatibility
attributes:
CheckBox, OptionButton POW-CHECK PIC S9(4) COMP-5
ScrollBar POW-SCRPOSITION PIC S9(4) COMP-5
Others None.
ValueTips Property
Description: Indicates whether the value of the Value property is displayed in a tool tip
box as the user drags the sliding pointer ("thumb").
Used in control(s): Slider
Values (with constants): True - Displays tool tips. (POW-TRUE)
False - Does not display tool tips. (POW-FALSE)
Default value: False - Does not display tool tips. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Visible Property
Description: Determines whether the control or object is displayed.
Used in control(s):
Controls Controls that can be displayed at execution time.
Objects Button Form MenuItem
Values (with constants): True - Displayed. (POW-TRUE)
False - Not displayed. (POW-FALSE)
MCI The display is not affected by the setting of this property when the
UseControlWindow property is True.
Default value: True - Displayed. (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility POW-VISIBLE PIC S9(4) COMP-5
attribute:
258 Chapter 4. Properties
VScrollBar Property
Description: Determines whether to use a vertical scrollbar in the TextBox control.
Used in control(s): TextBox
Values (with constants): True - Displays a vertical scrollbar. (POW-TRUE)
False - Does not display a vertical scrollbar. (POW-FALSE)
It is only effective when the MultiLine property is True.
Default value: False - Does not display a vertical scrollbar. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Reference only.
Backward compatibility None.
attribute:
Weight Property
Description: Defines the weight of the characters – bold or normal.
Used in object: Font
Values (with constants): The weight of the characters:
Normal (POW-FONTWEIGHT-NORMAL)
Bold (POW-FONTWEIGHT-BOLD)
Default value: Depends on the container's Font property.
COBOL picture: S9(4) COMP-5
OLE Data type: VT_I2
Design time access: Not accessible.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Chapter 4. Properties 259
Width Property
Description: Defines the width of the control or object.
Used:
Controls Sizable controls.
Objects Column Form TableColumn
Values:
Column and TableColumn The width of the column specified in the units defined by the ScaleMode
property.
Others The width of the control, or object, specified in the units defined by the
ScaleMode property.
Default value:
Column and TableColumn 100 pixels (when ScaleMode property is "0 - Pixel")
Others None.
COBOL PICTURE:
Column and TableColumn COMP-1
Others S9(9) COMP-5
OLE data type:
Column and TableColumn OLE_XSIZE_CONTAINER
Others VT_I4
Design time access:
Form Not accessible.
Toolbar Set and reference.
Note that, when the Align property is "1 - Top" or "2 - Bottom", this is
reference only.
Others Set and reference.
Execution time access:
Toolbar Set and reference.
Note that, when the Align property is "1 - Top" or "2 - Bottom", this is
reference only.
Others Set and reference.
Backward compatibility
attribute:
Column and TableColumn None.
Others POW-POSITION - made up of the following elements.
This property corresponds to POS-WIDTH.
01 POSITIONS.
02 POS-X PIC S9(4) COMP-5.
02 POS-Y PIC S9(4) COMP-5.
02 POS-WIDTH PIC S9(4) COMP-5.
02 POS-HEIGHT PIC S9(4) COMP-5.
260 Chapter 4. Properties
WindowAdjustment Property
Description: Indicates whether to match the size of the MCI control window with the size
of the media image.
Used in control(s): MCI
Values (with constants): 0 - Standard: (POW-MCIWINADJUST-STANDARD)
No adjustment.
1 - Adjust Control Window: (POW-MCIWINADJUST-CONTROLWINDOW)
Adjusts image to fit window.
2 - Adjust Device Frame: (POW-MCIWINADJUST-DEVICEFRAME)
Adjust window to fit image.
It is only effective when the UseControlWindow property is True.
Default value: 0 - Standard: (POW-MCIWINADJUST-STANDARD)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
WindowState Property
Description: Defines the initial state of the Form window.
Used object: Form
Values (with constants): 0 - Normal (POW-WINDOWSTATE-NORMAL)
1 - Maximize (POW-WINDOWSTATE-MAXIMIZE)
2 - Minimize (POW-WINDOWSTATE-MINIMIZE)
If you invoke the Execute method with the ShowWindow parameter (the
second parameter) and the WindowState value is 0, the state specified in
the ShowWindow parameter takes precedence over the WindowState
setting.
Default value: 0 - Normal (POW-WINDOWSTATE-NORMAL)
COBOL picture: S9(4) COMP-5
OLE data type: VT_I2
Design time access: Set and reference.
Execution time access: Not accessible.
Backward compatibility None.
attribute:
Chapter 4. Properties 261
WordWrap Property
Description: Indicates whether text wraps to the next line.
Used object: TableColumn
Values (with constants): True - Wraps text. (POW-TRUE)
False - Does not wrap text. (POW-FALSE)
Default value: False - Does not wrap text. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Wrapable Property
Description: Indicates whether to wrap the Toolbar buttons to another line, when the
buttons do not fit on a single line.
Used object: Toolbar
Values (with constants): True - Wraps buttons to another line. (POW-TRUE)
False - Does not wrap the buttons to another line. (POW-FALSE)
Default value: False - Does not wrap the buttons to another line. (POW-FALSE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
Writable Property
Description: Indicates whether cells in the column can gain focus and be edited.
Used object: TableColumn
Values (with constants): True: Cells can gain focus and be edited (POW-TRUE)
False: Cells cannot gain focus (POW-FALSE)
Default value: True: Cells can gain focus and be edited (POW-TRUE)
COBOL picture: S9(4) COMP-5
OLE data type: VT_BOOL
Design time access: Set and reference.
Execution time access: Set and reference.
Backward compatibility None.
attribute:
262 Chapter 4. Properties
Chapter 5. Methods
This chapter describes all of the PowerCOBOL methods.
Activate Method
Description: Activates a form.
The form object must be loaded.
Used in controls: None.
Used in objects: Form
Parameters: None.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE indicates normal completion.
POW-FALSE indicates an error.
Example: INVOKE Form-Name "Activate" RETURNING ReturnValue
Add Method
Description: Adds a ListItem object to a ListView control or a child Node object to the
TreeView control and Node object.
Used in controls: ListView TreeView
Used in objects: Node
Parameters:
ListView 1. VT_I4 - IconIndex S9(9) COMP-5
2. VT_I4 - SmallIconIndex S9(9) COMP-5
TreeView and 1. VT_BSTR - TextString X(8192)
Node 2. VT_I4 - ImageIndex S9(9) COMP-5]
3. [VT_I4 - SelectImageIndex S9(9) COMP-5]
4. [VT_I4 - ExpandImageIndex S9(9) COMP-5]
Description of Parameters:
ListView 1. IconIndex: Contains the index of the image to use in the large icon
display style. It is only used when the LVStyle property is "0 - Large
icon".
2. SmallIconIndex: Contains the index of the image to use in the small icon
display style. It is only used when the LVStyle property is "1 - Small
icon".
TreeView and 1. TextString: Contains the text displayed at the Node object.
Node 2. ImageIndex: Contains the index of the image to use for the Node
object.
3. SelectImageIndex: Contains the index of the image to use when the
Node object is selected.
4. ExpandImageIndex: Contains the index of the image to use when the
Node object is expanded
Return value: VT_I4 - ReturnValue S9(9) COMP-5
The index of the added item (ListItem object or Node object).
266 Chapter 5. Methods
Examples:
Listview: INVOKE ListView-Name "Add"
USING Icon
SmallIcon
RETURNING ReturnValue
TreeView control, Node INVOKE Node-Name "Add"
object:: USING Text
Image
SelectedImage
ExpandedImage
RETURNING ReturnValue
Backward compatibility None.
method name:
AddString Method
Description: Adds the character string contained in the parameter to the end of the list
or, if the Sorted property is set to True, inserts the character string in the list
at the appropriate position to maintain the sort order.
ComboBox Adds the character string contained in the TextString parameter to the end
of the list, or in sort order if Sorted is True, when the FileType property is
something other than "0 - Standard Text File".
Used in controls: ComboBox ListBox
Used in objects None.
Parameters: VT_BSTR - TextString X(8192)
Description of Parameters: Contains the string to add to the list.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
If positive, this is the index of the added item.
-1 indicates an error.
Example: MOVE "This is a new String"
TO StringToAdd
INVOKE ComboBox-Name "AddString"
USING StringToAdd
RETURNING ReturnValue
Backward compatibility ADDSTRING
method name: ADDSTRING256
Backward compatibility ADDSTRING : X(64)
arguments: ADDSTRING256 : X(256)
Chapter 5. Methods 267
AddTick Method
Description: Adds a graduation mark ("tick") at the specified position.
It is only effective if the AutoTick property is False.
Used in controls: Slider
Used in objects: None.
Parameters: VT_I4 - TickPosition S9(9) COMP-5
Description of Parameters: Specifies the position where the tick should be added.
The TickPosition property is an array containing the positions of all the ticks
Return value: VT_I4 - ReturnValue S9(9) COMP-5
The total number of ticks added using AddTick methods.
Example: WORKING-STORAGE SECTION.
01 lPos PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Turn off any auto tick marks
MOVE POW-FALSE
TO "AutoTick" OF CmSlider1
* Create a Tickmark at position 20
MOVE 20 TO lPos
INVOKE CmSlider1 "AddTick"
USING lPos
RETURNING ReturnValue
Backward compatibility None.
method name:
AdviseDDE Method
Description: Starts the advise loop with the DDE server.
Used in controls: DDE
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: * First point to the DDE control
* "DDE-name" at a valid DDE server
* such as Excel (using the InitiateDDE
* method) then:
INVOKE DDE-Name "AdviseDDE"
RETURNING ReturnValue
Backward compatibility ADVISEDDE
method name:
Backward compatibility None.
arguments:
268 Chapter 5. Methods
Alarm Method
Description: Plays the wave file configured for the defined sound in the Windows system.
Used in controls: None.
Used in objects: Form
Parameters: [VT_I4 - SoundType S9(9) COMP-5]
Description of Parameters: Defines the sound to use. You can use the following constants to set the
sound.
POW-MBOK: (Default) The default sound (Normal)
POW-MBASTERISK: The Asterisk sound (Information)
POW-MBQUESTION: The Question sound
POW-MBEXCLAMATION: The Exclamation sound (Warning)
POW-MBHAND: The Critical Stop sound
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Non-zero indicates normal completion.
Zero indicates an error.
Example: * Play the exclamation sound for the
* current form
INVOKE POW-SELF "Alarm"
USING POW-MBEXCLAMATION
RETURNING ReturnValue
Backward compatibility ALARM
method name:
Backward compatibility S9(4) COMP-5
arguments:
Chapter 5. Methods 269
CallForm Method
Description: Opens (Shows) a form in "Modal" mode.
"Modal" means that the parent form is inactive until the child form is closed.
The child form looks like a dialog box.
It is different from the OpenForm method in that control is returned after all
the child form's procedures have completed.
The child form cannot be re-opened if the child form is already open.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - FormName X(8192)
2. [VT_BSTR - DllName X(8192)]
3. [VT_I4 - Cookie S9(9) COMP-5]
Description of Parameters: 1. FormName: The name of the form to be opened.
2. DllName: When the form is in a DLL file, defines the name of the DLL
file containing the form.
It should be omitted when you specify a form in the same Module, as
specifying the same DLL name that contains the invoking form degrades
performance.
3. Cookie: An integer to distinguish the opened form.
It is set in a parameter of the CloseChild
event when the opened form is closed. If omitted, the parameter value
is zero.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
This is the value set in the Result parameter when the CloseForm method is
invoked.
When you omit the parameter, or the form is closed in some way other than
by invoking methods, the value is zero. Otherwise, if the form was not
closed for any reason, the value is -1.
DLL Search Path: When the DllName parameter does not contain the full path, PowerCOBOL
searches for the DLL folders in the following order:
1. The folder containing the execution file.
2. The current folder
3. The system folder of 32 bit Windows
4. The system folder of 16 bit Windows
5. The folder in which Windows is installed.
6. The folders of the PATH environment variable.
Example: To invoke another form called "DialogBox1", contained within the same
module, you would code:
WORKING-STORAGE SECTION.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
INVOKE POW-SELF "CallForm"
USING "DialogBox1"
RETURNING ReturnValue
IF ReturnValue = ID-OK
* Code to handle a good return
:
END-IF
270 Chapter 5. Methods
Where ID-OK is a global variable set in a top-level section of each form, such
as the forms' CONSTANT sections:
01 ID-OK PIC S9(9) COMP-5 VALUE 1
IS GLOBAL.
To return from "DialogBox1", with an "OK" value you would code, in a
closing event such as the user clicking on DialogBox1's "OK" button:
INVOKE POW-SELF "CloseForm"
USING ID-OK
Backward compatibility None.
method name:
Chapter 5. Methods 271
CallForm2 Method
Description: Opens (Shows) a form in "Modal" mode, taking an extra, modal style,
parameter to the CallForm method.
"Modal" means that the parent form is inactive until the child form is closed.
The child form looks like a dialog box.
It is different from the OpenForm method in that control is returned after all
the child form's procedures have completed.
The child form cannot be re-opened if the child form is already open.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - FormName X(8192)
2.[VT_BSTR - DllName X(8192)]
3.[VT_I4 - Cookie S9(9) COMP-5]
4.[VT_I4 - ModalStyle S9(9) COMP-5]
Description of 1. FormName: The name of the form to be opened.
Parameters: 2. DllName: When the form is in a DLL file, defines the name of the DLL file
containing the form.
It should be omitted when you specify a form in the same Module, as
specifying the same DLL name that contains the invoking form degrades
performance.
3. Cookie: An integer to distinguish the opened form.
It is set in a parameter of the CloseChild
event when the opened form is closed. If omitted, the parameter value is
zero.
4. ModalStyle: A modal style. Either:
POW-MODALSTYLE-APPLICATIONMODAL:
Only the parent form is inactive.
or:
POW-MODALSTYLE-TASKMODAL: (Default)
All forms in the same thread, except the opened form, are inactive.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
This is the value set in the Result parameter when the CloseForm method is
invoked.
When you omit the parameter, or the form is closed in some way other than
by invoking methods, the value is zero. Otherwise, if the form was not closed
for any reason, the value is -1.
DLL Search Path: When the DllName parameter does not contain the full path, PowerCOBOL
searches for the DLL folders in the following order:
1. The folder containing the execution file.
2. The current folder
3. The system folder of 32 bit Windows
4. The system folder of 16 bit Windows
5. The folder in which Windows is installed.
6. The folders of the PATH environment variable.
Backward compatibility None.
method name:
272 Chapter 5. Methods
ChangeDDEItem Method
Description: Re-connects the advise loop, using a new DDE item name.
Used in controls: DDE
Used in objects: None.
Parameters: 1. VT_BSTR - DDEItemName X(8192)
2. VT_BSTR - DDEFormatName X(8192)
Description of Parameters: 1. DDEItemName: The new DDE item name.
2. DDEFormatName: The format name of the new DDE item.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: See the ChangeDDEItem Example
Backward compatibility CHANGEDDEITEM
method name:
Backward compatibility 1. X(128)
arguments: 2. X(32)
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
INVOKE CmDDE1 "Execute" Using
"Excel c:\exceldde97.xls"
POW-SWSHOWNORMAL
Returning ReturnValue
INVOKE CmDDE1 "OpenDDE"
RETURNING ReturnValue
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 DDE-Item Pic X(16).
01 DDE-Format Pic X(16).
01 ReturnValue Pic S9(9) COMP-5.
PROCEDURE DIVISION.
Move "R1C1:R2C2" To DDE-Item
Move "CF_TEXT" To DDE-Format
INVOKE CmDDE1 "ChangeDDEItem"
USING DDE-Item
DDE-Format
RETURNING ReturnValue
Chapter 5. Methods 273
Clear Method
Description: Deletes all objects or items from the control or object.
ListView Deletes all ListItem objects.
TreeView Deletes all items.
Node Deletes all child Node objects.
Used in controls: ListView TreeView
Used in objects: Node
Parameters: None.
Return value: None.
Example: INVOKE CmListView1 "Clear"
ClearList Method
Description: Deletes all items in the list box part.
Used in controls: ComboBox ListBox
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmList1 "ClearList"
ClearSelect Method
Description: Clears the selected range, setting SelectStart property and SelectEnd
property to their Min property value.
Used in controls: Slider
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmSlider1 "ClearSelect"
ClearTable Method
Description: Clears the contents of all cells except the heading area.
Used in controls: Table
Used in objects: None.
Parameters: None.
Return value: None.
Example INVOKE CmTable1 "ClearTable"
ClearTicks Method
Description: Clears all the graduation marks ("Ticks") from the slider, apart from the tick
at the Min property and Max property positions.
It is effective only when the AutoTick property is False.
Used in controls: Slider
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmSlider1 "ClearTicks"
CloseBook Method
Description: Closes the Excel book.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: 1. [VT_BOOL - CloseAll S9(4) COMP-5]
2. [VT_BOOL - SaveChanges S9(4) COMP-5]
Description of Parameters: 1. CloseAll: Specify whether to close all the books connected with the
PowerCOBOL application or only the books connected with the control.
POW-TRUE: Close all the books connected with the PowerCOBOL
application.
POW-FALSE: Close the books connected with the control.
If omitted, all books connected with the PowerCOBOL application are
closed.
2. SaveChanges: Specify whether to save the book connected with the
control. This parameter is effective only when the first parameter
(CloseAll) is False.
POW-TRUE: Save the book connected with the control.
POW-FALSE: Do not save the book.
If omitted, a confirming message box is displayed.
Return value: None.
Example: INVOKE CmExcel "CloseBook"
CloseCursor Method
Description: Closes the cursor (or result set) created by the SelectRecords method or
ExecuteProcedure method.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "CloseCursor"
RETURNING ReturnValue
Backward compatibility None.
method name:
276 Chapter 5. Methods
CloseDB Method
Description: Ends the data base connection.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "CloseDB"
RETURNING ReturnValue
Backward compatibility CLOSEDB
method name:
Backward compatibility None.
arguments:
CloseDDE Method
Description: Ends the advise loop with the DDE server and closes the DDE conversation.
Its effect is the same as if you executed the UnadviseDDE and
TerminateDDE methods successively.
Used in controls: DDE
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmDDE1 "CloseDDE"
CloseDevice Method
Description: Closes the MCI device.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "CloseDevice"
CloseForm Method
Description: Closes the form and child forms opened from the form.
Used in controls: None.
Used in objects: Form
Parameters: 1. [VT_BSTR - FormName X(8192)]
2. [VT_BSTR - DllName X(8192)]
3. [VT_I4 - Result S9(9) COMP-5]
Description of Parameters: 1. FormName: The name of the form to be closed.
When it is omitted with the DllName parameter, the form itself is closed
(its effect is equal to the Deactivate method).
2. DllName: The name of the DLL file containing the form.
If it is omitted PowerCOBOL searches for the form name in the
application.
3. Result: This value is set to the ResultValue parameter passed to the
CallForm2 (CallForm) method. (This parameter is not effective for a
form opened with the OpenForm method).
Note that the order of parameters is different from the order of
CLOSESHEET's parameters.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero indicates normal completion.
Non-zero indicates an error.
Note: If event procedures in the form to be closed have not finished, the
CloseForm method waits for them to complete.
Example: 1. To close a form itself code:
INVOKE POW-SELF "CloseForm"
USING Result-Code
Where Result-Code contains a value you wish to communicate to the
invoking form.
2. To close a form called "Subform1" from another form, contained in the
same DLL module, code:
INVOKE POW-SELF "CloseForm"
USING "Subform1"
Backward compatibility CLOSESHEET
method name:
Backward compatibility 1. X(260) - DLL
arguments: 2. X(14) - Sheet (form) name
278 Chapter 5. Methods
CommitDB Method
Description: Execute the commit procedure when the CommitMode property is "1 -
Manual".
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "CommitDB"
RETURNING ReturnValue
Backward compatibility COMMITDB
method name:
Backward compatibility None.
arguments:
Connect Method
Description: Does not do anything. It is provided for backward compatibility with an
earlier function so that code can still be interchanged.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmExcel1 "Connect"
Backward compatibility CONNECTEXCEL
method name:
Backward compatibility None.
arguments:
Chapter 5. Methods 279
ConvertScale Method
Description: Converts coordinates between specified scale modes.
The details of scale mode are described in the ScaleMode property.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I2 - ScaleModeIn S9(4) COMP-5
2. VT_I2 - ScaleModeOut S9(4) COMP-5
3. VT_I4 - PosX S9(9) COMP-5
4. VT_I4 - PosY S9(9) COMP-5
Description of Parameters: 1. ScaleModeIn: The scale mode of the input coordinates. Valid values
(with constants) are:
0 - Pixels (POW-SCALEPIXELS)
1 - 1/100mm (POW-SCALEHIMETRIC)
2 - 1/1000inch (POW-SCALEHIENGLISH)
3 - 1/20Points (POW-SCALETWIPS)
2. ScaleModeOut: The scale mode to be used for the output coordinates.
Valid values (with constants) are:
0 - Pixels (POW-SCALEPIXELS)
1 - 1/100mm (POW-SCALEHIMETRIC)
2 - 1/1000inch (POW-SCALEHIENGLISH)
3 - 1/20Points (POW-SCALETWIPS)
3. PosX: The horizontal coordinates to be converted. The converted value
is returned in this parameter.
4. PosY: The vertical coordinates to be converted. The converted value is
returned in this parameter
Return value: None.
Example: WORKING-STORAGE SECTION.
01 ScaleModeIn PIC S9(4) COMP-5.
01 ScaleModeOut PIC S9(4) COMP-5.
01 X PIC S9(9) COMP-5.
01 Y PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* This example obtains the current
* scale mode (Default is "3" = 1/20
* points), and converts 100 and 200
* in that scale mode, to their
* values in scale mode "0" pixels).
MOVE "ScaleMode" OF POW-SELF
TO ScaleModeIn
MOVE 0 TO ScaleModeOut
MOVE 100 TO X
MOVE 200 TO Y
INVOKE POW-SELF "ConvertScale"
USING ScaleModeIn ScaleModeOut
X Y
Backward compatibility None.
method name:
280 Chapter 5. Methods
Deactivate Method
Description: Deactivates the form.
Used in controls: None.
Used in objects: Form
Parameters: None.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE indicates normal completion.
POW-FALSE indicates an error.
Example: INVOKE POW-SELF "Deactivate"
RETURNING ReturnValue
Backward compatibility None.
method name:
Delete Method
Description: Deletes the specified item or object.
ListView Deletes a specified ListItem object.
TreeView Deletes the specified root Node object and all child Node objects included in
it.
Node Deletes a child Node object.
Used in controls: ListView TreeView
Used in objects: Node
Parameters: VT_I4 - ObjectIndex S9(9) COMP-5
Description of Parameters:
ListView The index of a ListItem object.
TreeView The index of a root Node object.
Node The index of a child Node object.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
ListView Number of the remaining ListItem objects.
TreeView Number of the remaining brother root Node objects.
Node Number of the remaining brother Node objects.
Example: WORKING-STORAGE SECTION.
01 IndexNum PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
Move 1 To IndexNum
INVOKE CmListView1 "Delete"
USING IndexNum
RETURNING ReturnValue
Backward compatibility None.
method name:
Chapter 5. Methods 281
DeleteCurRecord Method
Description: Deletes the current record. It does not work if ConcurrencyCursor property is
"1 - SQL_CONCUR_READ_ONLY".
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "DeleteCurRecord"
RETURNING ReturnValue
Backward compatibility None.
method name:
DeleteRecord Method
Description: Deletes a record in the table. It uses the Update/Delete key specified in the
DB Access property page.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater means the number of records deleted.
Negative indicates an error.
Example: INVOKE CmDB1 "DeleteRecord"
RETURNING ReturnValue
Backward compatibility DELETERECORD
method name:
Backward compatibility None.
arguments:
282 Chapter 5. Methods
DeleteString Method
Description: Deletes an item from the list box part.
ComboBox Deletes the record when the FileType property is not "0 - No Records".
Used in controls: ComboBox ListBox
Used in objects None.
Parameters: VT_I4 - ListItemIndex S9(9) COMP-5
Description of Parameters: The index of the item to be deleted. (The items in the list box are indexed by
consecutive numbers starting from 1.)
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater means the number of items remaining in the list box part.
-1 indicates an error.
Example: MOVE 1 TO IndexNum
INVOKE CmList1 "DeleteString"
USING IndexNum
RETURNING ReturnValue
Backward compatibility DELETESTRING
method name:
Backward compatibility S9(4) COMP-5
arguments:
DeleteTick Method
Description: Removes the graduation mark ("tick") from the specified position.
It is only effective if the AutoTick property is False.
Used in controls: Slider
Used in objects: None.
Parameters: VT_I4 - TickPosition S9(9) COMP-5
Description of Parameters: The position of the tick to be deleted.
The TickPosition property is an array containing the positions of all the ticks.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
The number of remaining ticks.
Example: MOVE 20 TO TickPos
INVOKE CmSlider1 "DeleteTick"
USING TickPos
RETURNING ReturnValue
Backward compatibility None.
method name:
Chapter 5. Methods 283
DisableCommit Method
Description: Notify Microsoft Transaction Server that transactions cannot be committed.
Used in controls: MTS Support
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmViper1 "DisableCommit"
Disconnect Method
Description: Does not do anything. It is provided for backward compatibility with an
earlier function so that code can still be interchanged.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmExcel1 "Disconnect"
DisplayMessage Method
Description: Displays a message box.
The user needs to respond to the message box (needs to select a button) to
continue the process.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - TextString X(8192)
2. VT_BSTR - MessageTitle X(8192)]
3. [VT_I4 - MessageStyle S9(9) COMP-5]
Description of Parameters 1. TextString: The text to be displayed in the message box. You can start
new lines in the message by inserting the value X"0A" in the TextString
data item.
2. MessageTitle: The text to be displayed in the message box title. If this
parameter is omitted PowerCOBOL uses the form Caption property in
the title.
3. MessageStyle: The style of the message box.
The style is defined by adding a value from each of the three groups
(type, icon and default button).
If this parameter is omitted PowerCOBOL uses the style of POW-
DMDEFAULT.
POW-DMDEFAULT:
This contains the defaults from all three groups. (A single OK button, no
icon and OK is the default button.)
Type Group The buttons to display.
POW-DMOK (The default): A single OK button.
POW-DMOKCANCEL: OK and Cancel buttons.
POW-DMABORTRETRYIGNORE: Abort (Stop), Retry and Ignore buttons.
POW-DMYESNOCANCEL: Yes, No and Cancel buttons.
POW-DMYESNO: Yes and No buttons.
POW-DMRETRYCANCEL: Retry and Cancel buttons.
Icon Group The icon to display.
POW-DMNOICON (The default): No icon.
POW-DMICONSTOP: Displays the stop icon.
POW-DMICONERROR: Displays the error icon.
POW-DMICONQUESTION: Displays the question mark icon.
POW-DMICONEXCLAMATION: Displays the exclamation mark icon.
POW-DMICONWARNING: Displays the warning icon.
POW-DMICONINFORMATION: Displays the information icon.
Note that currently:
stop icon = error icon
exclamation icon = warning icon
Default Button Group The button used when the ENTER key is pressed.
POW-DMDEFBUTTON1: (The default) The first button is the default.
POW-DMDEFBUTTON2: The second button is the default.
POW-DMDEFBUTTON3: The third button is the default.
Chapter 5. Methods 285
DoModal Method
Description: Activates the form in "Modal" mode.
It can only be used if the form is already loaded.
"Modal" means that the parent form that opened a child form is inactive until
the child form is closed.
It looks like a "Dialog box".
Used in controls: None.
Used in objects: Form
Parameters: None.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE indicates normal completion.
POW-FALSE indicates an error.
Example: See the DoModal Example
Backward compatibility None.
method name:
WORKING-STORAGE SECTION.
01 G-SUBFORM OBJECT REFERENCE OLE GLOBAL.
01 G-SUBFORM-OLENAME PIC X(32) VALUE "PowerCOBOL.SampleDialog1.1"
GLOBAL.
:
PROCEDURE DIVISION.
* Create the subform as an OLE server and activate it in modal state.
* Uses the special *OLE class that provides functions for working
* with OLE servers.
INVOKE OLE "CREATE-OBJECT" USING G-SUBFORM-OLENAME RETURNING G-
SUBFORM
* Disable the invoking form
MOVE POW-FALSE TO "Enabled" OF POW-SELF
* Pass text using the "SetString" custom method
INVOKE G-SUBFORM "SetString" USING WK-VALUE
* Open the sub-form in modal mode
INVOKE G-SUBFORM "DoModal"
* On return enable and activate the invoking form
MOVE POW-TRUE TO "Enabled" OF POW-SELF
INVOKE POW-SELF "Activate"
Chapter 5. Methods 287
DoModal2 Method
Description: Activates the form in "Modal" mode, taking a modal style parameter.
It can only be used if the form is already loaded.
"Modal" means that the parent form that opened a child form is inactive
until the child form is closed.
It looks like a "Dialog box".
Used in controls: None.
Used in objects: Form
Parameters: [VT_I4 - ModalStyle S9(9) COMP-5]
Description of Parameters: ModalStyle: A modal style. Either:
POW-MODALSTYLE-APPLICATIONMODAL: Only the parent form is inactive.
or:
POW-MODALSTYLE-TASKMODAL: (Default) All forms in the same thread.
except the activated form, are inactive.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE indicates normal completion.
POW-FALSE indicates an error.
Backward compatibility None.
method name:
EnableCommit Method
Description: Notify Microsoft Transaction Server that transactions can be committed.
Used in controls: MTS Support
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmViper1 "EnableCommit"
End Method
Description: Closes the Excel application.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmExcel1 "End"
RETURNING ReturnValue
Backward compatibility None.
method name:
EnsureVisible Method
Description: Ensures that the object is visible, scrolling the control list if necessary.
Used in controls: None.
Used in objects: ListItem Node
Parameters: None.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 ListItem PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE 1 TO ListItem
INVOKE "ListItems"(ListItem)
OF CmListView1
"EnsureVisible"
Backward compatibility None.
method name:
Chapter 5. Methods 289
Execute Method
Description: Executes an application.
Used in controls: DDE
Used in objects: Form
Parameters: 1. VT_BSTR - CommandLine X(8192)
2.[VT_I4 - ShowWindow S9(9) COMP-5]
Description of Parameters: 1. CommandLine: The command line for the application to be executed.
Includes the application name, command line parameters and, if
necessary, the full path name if that is different from the current
directory and the path is not set in the PATH environment variable.
2. ShowWindow: The manner in which the application should be invoked.
This parameter can be omitted in calling from the Form object. If it is
omitted PowerCOBOL uses POW-SWSHOWNORMAL as default.
Use the following constants to set the value of ShowWindow:
POW-SWHIDE: Starts the application in the background - it does not
display a window.
POW-SWSHOWNORMAL: (Default) Activates the application using its
default window size.
POW-SWNORMAL: Same as POW-SWSHOWNORMAL.
POW-SWSHOWMINIMIZED: Activates the application in the minimized
state.
POW-SWSHOWMINNOACTIVE: Starts the application in the minimized
state but leaves an active window unchanged.
POW-SWSHOWMAXIMIZED: Activates the application with the window
maximized.
Return value: Only the DDE control returns the return value.
VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Examples: See the Execute method examples
Backward compatibility EXECAPL
method name:
Backward compatibility 1. X(520)
arguments: 2. S9(9)COMP-5
290 Chapter 5. Methods
WORKING-STORAGE SECTION.
01 Command-Line PIC X(128).
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE "Notepad c:\autoexec.bat"
TO Command-Line
INVOKE CmDDE1 "Execute"
USING Command-Line
POW-SWSHOWNORMAL
RETURNING ReturnValue
Example 2:
Example 2 demonstrates how to execute a DOS Dir command under Windows NT.
For Windows 98 change "CMD" to "Command".
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Command-Line PIC X(128).
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* The "/K" option tells CMD to keep the DOS window open so you
* can see the results. Change this to "/C" if you want the
* window to close after the command executes.
MOVE "CMD /K Dir *.*" TO Command-Line
INVOKE CmDDE1 "Execute"
USING Command-Line
POW-SWSHOWNORMAL
RETURNING ReturnValue
Chapter 5. Methods 291
ExecuteDDECommand Method
Description: Executes a DDE server command.
Used in controls: DDE
Used in objects: None.
Parameters: VT_BSTR - CommandString X(8192)
Description of Parameters: The command to be executed by the DDE server.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: See the ExecuteDDECommand Example
Backward compatibility EXECUTEDDECMD
method name: EXECUTEDDECMD512
XECUTEDDECMD1024
Backward compatibility EXECUTEDDECMD : X(256)
arguments: EXECUTEDDECMD512 : X(512)
EXECUTEDDECMD1024 : X(1024)
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
INVOKE CmDDE1 "Execute" USING "Excel c:\exceldde97.xls"
POW-SWSHOWNORMAL
RETURNING ReturnValue
INVOKE CmDDE1 "InitiateDDE" RETURNING ReturnValue
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Excel-Command PIC X(128).
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE Spaces TO Excel-Command
MOVE "[OPEN(""C:\my.xls"")]" TO Excel-Command
INVOKE CmDDE1 "ExecuteDDECommand" USING Excel-Command
RETURNING ReturnValue
292 Chapter 5. Methods
ExecuteProcedure Method
Description: Executes the database procedure defined in the TargetName property.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: See the ExecuteProcedure Example
Backward compatibility None.
method name:
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ReturnValue PIC S9(9)COMP-5.
01 WorkRetVal PIC S9(9)COMP-5.
01 WorkParamOUT PIC S9(4)COMP-5.
PROCEDURE DIVISION.
*> Connect with the database.
*> The return value of the method is stored in ReturnValue.
INVOKE CmDb1"OpenDB" RETURNING ReturnValue.
*> Process the return value.
:
*> Set the input parameter to 1.
MOVE 1 TO "ParamIN" OF CmDb1.
*> Execute the procedure.
*> The return value of the method is stored in ReturnValue.
INVOKE CmDb1 "ExecuteProcedure" RETURNING ReturnValue.
*> Process the return value.
:
*> Save the procedure's return value in WorkRetVal.
MOVE "Ret_Val" OF CmDb1 TO WorkRetVal.
*> Save the procedure's output parameter in WorkParamOUT.
MOVE "ParamOUT" OF CmDb1 TO WorkParamOUT.
*> Use WorkRetVal and WorkParamOUT for the application processing.
:
*> Release the database connection.
INVOKE CmDb1 "CloseDB".
Chapter 5. Methods 293
ExecuteSync Method
Description: Executes an application synchronously.
Control is not returned to the invoking program until the executed application
terminates. (Note that the form remains active, it is just the invoking code
that waits for the application to terminate.)
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - CommandLine X(8192)
2. [VT_I4 - ShowWindow S9(9) COMP-5]
3. [VT_I4 – ReturnValue S9(9) COMP-5]
Description of 1. CommandLine: The command line for the application to be executed.
Parameters: Includes the application name, command line parameters and, if
necessary, the full path name if that is different from the current directory
and the path is not set in the PATH environment variable.
2. ShowWindow: The manner in which the application should be invoked.
This parameter can be omitted in calling from the Form object. If it is
omitted PowerCOBOL uses POW-SWSHOWNORMAL as default.
Use the following constants to set the value of ShowWindow:
POW-SWHIDE: Starts the application in the background - it does not
display a window.
POW-SWSHOWNORMAL: (Default) Activates the application using its
default window size.
POW-SWNORMAL: Same as POW-SWSHOWNORMAL.
POW-SWSHOWMINIMIZED: Activates the application in the minimized
state.
POW-SWSHOWMINNOACTIVE: Starts the application in the minimized
state but leaves an active window unchanged.
POW-SWSHOWMAXIMIZED: Activates the application with the window
maximized.
3. ReturnValue: The value that is returned from the command.
If the command does not return any value, the ReturnValue is not set.
Return value: None.
Example: Shows how to start the Windows Notepad with the autoexec.bat file loaded.
WORKING-STORAGE SECTION.
01 Command-Line PIC X(128).
PROCEDURE DIVISION.
MOVE "Notepad c:\autoexec.bat"
TO Command-Line
INVOKE MainForm "ExecuteSync"
USING Command-Line
POW-SWSHOWNORMAL
Backward None.
compatibility
method name:
294 Chapter 5. Methods
GetFileName Method
Description: Display the select file dialog.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - FileName X(8192)
2. VT_BSTR - DialogTitle X(8192)
3. VT_BSTR - MaskList X(8192)
4. VT_I4 - DialogStyle S9(9) COMP-5
Description of 1. FileName: The field in which the selected file name should be returned.
Parameters: 2. DialogTitle: The text for the title of the select file dialog.
3. MaskList: A Mask list to be used for the "Files of type" list box in the
select file dialog.
The mask contains pairs of character strings, each pair being separated
by the character "|" (vertical bar). The strings within the pairs are also
separated by the "|" character.
The first string in each pair gives a description to be displayed in the list
box; the second string in each pair gives the corresponding pattern (or
filter).
For example to let the user select a list of all files or only text files, set up
Mask with the following string:
"All files|*.*|Text files|*.txt"
4. DialogStyle: The style of the select file dialog. The style is obtained by
adding a value from each of the groups (type and folder).
Use the constants described below to set DialogStyle.
Type Group The type of dialog to be displayed:
POW-CDLFNAME: Neither the head of the pattern in the mask list nor the
blank at the end is removed.
POW-CDOPEN: (The default) Open file dialog.
POW-CDSAVE: Save file dialog.
Folder Group Whether the current folder is changed when the user changes folders.
POW-CDCHANGEDIR: (The default) Changes the current folder.
POW-CDNOCHANGEDIR: Does not change the current folder.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means the Open or Save button was pushed.
POW-FALSE means the Cancel button was pushed.
Example: See the GetFileName Example
Backward GETFILENAME
compatibility
method name:
Backward 1. X(260)
compatibility 2. X(60)
arguments: 3. X(128)
4. S9(4) COMP-5
Chapter 5. Methods 295
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 Filename PIC X(256).
01 FileMask PIC X(30).
01 FileStyle PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Specify the types of files to list
MOVE "All files|*.*|Text files|*.txt"
TO FileMask
* Specify the File Open dialog.
* (Change this to POW-CDSAVE if you need
* the File Save Dialog.)
ADD POW-CDOPEN TO FileStyle
GetFolderName Method
Description: Display the select folder dialog.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - FolderName X(8192)
2. VT_BSTR - DialogTitle X(8192)
3. [VT_BOOL - NoChangeCurrent S9(4) COMP-5]
Description of Parameters: 1. FolderName: The field in which the selected folder name should be
returned.
If FolderName is passed with a value set, the value becomes the initial
folder of the dialog. If FolderName is not set (SPACE) the current folder
becomes the initial folder of the dialog.
2. DialogTitle: The text for the title of the select folder dialog.
3. NoChangeCurrent: Whether to change the current folder to the selected
folder or not.
The current folder is not changed if NoChangeCurrent is set to POW-
TRUE or the parameter is omitted. The current folder is changed if
NoChangeCurrent is set to POW-FALSE.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means the OK button was pushed.
POW-FALSE means the Cancel button was pushed.
Backward compatibility None.
method name:
296 Chapter 5. Methods
GetHotData Method
Description: Acquires data from the DDE server when a DDECHANGE event is generated
by the hot link.
The maximum length that can be acquired at a time is 1024 bytes. When
you need to acquire data of 1024 bytes or more, you get it in 1024 byte
chunks.
Used in controls: DDE
Used in objects: None.
Parameters: No OLE data types.
HotData: A group item whose length is 1028 bytes.
Description of Parameters: HotData has the following elementary items:
DataLength S9(9) COMP-5
The length of the data in the buffer. If the total data length is longer than a
single buffer can contain, use the DDEDataOffset property to track the data
over multiple calls.
DataArea X(1024)
The data from the DDE server
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: WORKING-STORAGE SECTION.
01 Hot-Data.
03 Buffer-Length PIC S9(9) COMP-5.
03 Hot-Buffer PIC X(1024)
VALUE Spaces.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
COMPUTE Buffer-Length
= LENGTH OF Hot-Buffer
INVOKE CmDDE1 "GetHotData"
USING Hot-Data
RETURNING ReturnValue
Backward compatibility GETHOTDATA
method name:
Backward compatibility A group item made up of the following elementary items.
arguments: 1.S9(9) COMP-5
2.X(1024)
Chapter 5. Methods 297
GetScreenSize Method
Description: Acquires the dimensions of the screen in the units defined in the ScaleMode
parameter.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I4 - ScreenWidth S9(9) COMP-5
2. VT_I4 - ScreenHeight S9(9) COMP-5
3. [VT_I2 - ScaleMode S9(4) COMP-5]
Description of Parameters: 1. ScreenWidth: Returns the width of the screen.
2. ScreenHeight: Returns the height of the screen.
3. ScaleMode: The units to be used. If omitted, PowerCOBOL uses the
ScaleMode property value. Use the values (with equivalent constants)
0 - Pixels (POW-SCALEPIXELS)
1 - 1/100mm (POW-SCALEHIMETRIC)
2 - 1/1000inch (POW-SCALEHIENGLISH)
3 - 1/20Points (POW-SCALETWIPS)
Return value: None.
Example: WORKING-STORAGE SECTION.
01 ScreenWidth PIC S9(9) COMP-5.
01 ScreenHeight PIC S9(9) COMP-5.
01 ScreenScale PIC S9(4) COMP-5.
PROCEDURE DIVISION.
* Specify the scale desired -
* Pixels in this example
MOVE 0 To ScreenScale
INVOKE MainForm "GetScreenSize"
USING ScreenWidth
ScreenHeight
ScreenScale
Backward compatibility GETSCREENSIZE
method name:
Backward compatibility A group item having the following elementary items.
arguments: 1.S9(4) COMP-5
2.S9(4) COMP-5
298 Chapter 5. Methods
GetWorkArea Method
Description: Acquires the dimensions of the available display area on the screen - the
screen size, less areas occupied by the task bar(s). Uses the units defined in
the ScaleMode parameter.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I4 - WorkAreaLeft S9(9) COMP-5
2. VT_I4 - WorkAreaTop S9(9) COMP-5
3. VT_I4 - WorkAreaWidth S9(9) COMP-5
4. VT_I4 - WorkAreaHeight S9(9) COMP-5
5. [VT_I2 - ScaleMode S9(4) COMP-5]
Description of Parameters: 1. WorkAreaLeft: Returns the position of the left side of the screen work
area.
2. WorkAreaTop: Returns the position of the top side of the screen work
area.
3. WorkAreaWidth: Returns the width of the screen work area.
4. WorkAreaHeight: Returns the height of the screen work area.
5. ScaleMode: The units to be used. If omitted, PowerCOBOL uses the
ScaleMode property value. Use the values (with equivalent constants)
0 - Pixels (POW-SCALEPIXELS)
1 - 1/100mm (POW-SCALEHIMETRIC)
2 - 1/1000inch (POW-SCALEHIENGLISH)
3 - 1/20Points (POW-SCALETWIPS)
Return value: None.
Example: WORKING-STORAGE SECTION.
01 ScreenLeft PIC S9(9) COMP-5.
01 ScreenTop PIC S9(9) COMP-5.
01 ScreenWidth PIC S9(9) COMP-5.
01 ScreenHeight PIC S9(9) COMP-5.
01 ScreenScale PIC S9(4) COMP-5.
PROCEDURE DIVISION.
* Specify the scale desired -
* Pixels in this example
MOVE 0 TO ScreenScale
INVOKE MainForm "GetWorkArea"
USING ScreenLeft
ScreenTop
ScreenWidth
ScreenHeight
ScreenScale
Backward compatibility None.
method name:
Chapter 5. Methods 299
InitiateDDE Method
Description: Opens a DDE conversation with DDE server.
Used in controls: DDE
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDDE1 "InitiateDDE"
RETURNING ReturnValue
Backward compatibility INITIATEDDE
method name:
Backward compatibility None.
arguments:
300 Chapter 5. Methods
Insert Method
Description: Inserts the Node object at the specified index position.
TreeView If the Sorted property is set to True, the Node object is sorted immediately
after the insert.
Used in controls: TreeView
Used in objects: Node
Parameters: 1. VT_I4 - InsertIndex S9(9) COMP-5
2. VT_BSTR - TextString X(8192)
3. [VT_I4 - ImageIndex S9(9) COMP-5]
4. [VT_I4 - SelectImageIndex S9(9) COMP-5]
5. [VT_I4 - ExpandImageIndex S9(9) COMP-5]
Description of Parameters: InsertIndex: The index position at which the Node object is inserted.
TextString: The character string displayed in the Node object.
ImageIndex: The index of an image for the Node object.
SelectImageIndex: The index of an image to use when the Node object is
selected.
ExpandImageIndex: The index of an image to use when the Node object is
expanded.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 Ipos PIC S9(9) COMP-5.
01 iString PIC X(20).
01 ImageIndex PIC S9(9) COMP-5.
01 SelimageIndex PIC S9(9) COMP-5.
01 ExpimageIndex PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE 1 TO iPos
MOVE "My Item" TO iString
MOVE 1 TO ImageIndex
SelimageIndex
ExpimageIndex
INVOKE CmTreeView1 "Insert"
USING iPos
iString
ImageIndex
SelimageIndex
ExpimageIndex
RETURNING ReturnValue
Backward compatibility None.
method name:
Chapter 5. Methods 301
InsertListItem Method
Description: Inserts a ListItem object at the specified index position.
Used in controls: ListView
Used in objects: None.
Parameters: 1. VT_BSTR - TextString X(8192)
2.[VT_I4 - IconIndex S9(9) COMP-5]
3.[VT_I4 - SmallIconIndex S9(9) COMP-5]
4.[VT_I4 - InsertIndex S9(9) COMP-5]
Description of Parameters: 1. TextString: The character string to be displayed in the ListItem object.
It corresponds to the value of Text(ListItem) property.
2. IconIndex: The index of the large icon for the ListItem object.
It is only effective when the Icons property is specified.
3. SmallIconIndex: The index of the small icon for the ListItem object.
It is only effective when the SmallIcons property is specified.
4. InsertIndex: The index position at which the ListItem object is inserted.
The value is an integer greater than zero.
If omitted, the ListItem is added to the end of the list.
Note: The ListItem is not inserted into the position specified by
InsertIndex if the LVStyle property is "0 - LargeIcon" or "1 - SmallIcon".
The ListItem is added at the last position.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
If positive, this is the index of the inserted item.
Example: INVOKE CmCombo1 "InsertString"
USING TextString
IconIndex
SmallIconIndex
InsertIndex
RETURNING ReturnValue
Backward compatibility None.
method name:
302 Chapter 5. Methods
InsertString Method
Description: Inserts a character string contained in the first parameter at the position
contained in the second parameter.
Used in controls: ComboBox ListBox
Used in objects: None.
Parameters: 1. VT_BSTR - TextString X(8192)
2. VT_I4 - Index S9(9) COMP-5
Description of Parameters: 1. TextString: Contains the string to insert to the list.
2. Index: The index position at which the string is inserted.
The value is an integer greater than zero. The string is inserted at the
top of the list if the value is 1, and inserted at the end of the list if the
value is ListCount property plus 1.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
If positive, this is the index of the inserted item.
-1 indicates an error (for example, the data type is not correct)
Example: INVOKE CmCombo1 "InsertString"
USING TextString
Index
RETURNING ReturnValue
Backward compatibility None.
method name:
IsCallerInRole Method
Description: Determines whether the caller is in the role.
Used in controls: MTS Support
Used in objects: None.
Parameters: VT_BSTR - RoleName X(8192)
Description of Parameters: The name of the role.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means the caller is in the role.
POW-FALSE means the caller is not in the role.
Example: INVOKE CmViper1 "IsCallerInRole"
USING RoleName
RETURNING ReturnValue
Backward compatibility None.
method name:
Chapter 5. Methods 303
IsInTransaction Method
Description: Determines whether the current object is being executed as a transaction.
Used in controls: MTS Support
Used in objects: None.
Parameters: None.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means the object is being executed as a transaction.
POW-FALSE means the object is not being executed as a transaction.
Example: INVOKE CmViper1 "IsInTransaction"
RETURNING ReturnValue
Backward compatibility None.
method name:
IsSecurityEnabled Method
Description: Determines whether security is enabled.
Used in controls: MTS Support
Used in objects: None.
Parameters: None.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means security is enabled.
POW-FALSE means security is not enabled.
Example: INVOKE CmViper1 "IsSecurityEnabled"
RETURNING ReturnValue
Backward compatibility None.
method name:
304 Chapter 5. Methods
LoadFile Method
Description: Load the contents of the file to the control.
ComboBox and Adds the contents of the file to the list box part.
ListBox
TextBox Sets the Text property to the contents of the file. The text values depend on
RenderText property. Non-display values are to be ignored.
Used in controls: ComboBox ListBox TextBox
Used in objects: None.
Parameters: VT_BSTR - FileName X(8192)
Description of Parameters: The name of the file to be read.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 LoadFileName PIC X(256).
PROCEDURE DIVISION.
MOVE "C:\my.txt" TO LoadFileName
INVOKE CmText1 "LoadFile"
USING LoadFileName
Backward compatibility LOADFILE
method name:
Backward compatibility X(260)
arguments:
Chapter 5. Methods 305
Move Method
Description: Moves the control to the specified position.
The units are those defined in the ScaleMode property of the control being
moved.
Toolbar It is effective when the Align property is "0 - None".
Used in controls: Animation FileList ListBox Slider
CheckBox FolderList ListView StaticText
ComboBox Frame MCI Tab
CommandButton Graph OptionButton Table
Custom GroupBox ProgressIndicator TextBox
DriveList Image ScrollBar Toolbar
Edit Label Shape TreeView
Used in objects: None.
Parameters: 1. VT_I4 - Left S9(9) COMP-5
2. VT_I4 - Top S9(9) COMP-5
3. [VT_I4 - Width S9(9) COMP-5]
4. [VT_I4 - Height S9(9) COMP-5]
Description of Parameters: 1. Left: The new horizontal position for the top left corner of the control.
2. Top: The new vertical position for the top left corner of the control.
3. Width: The new width for the control.
4. Height: The new height for the control.
If Width and Height parameters are omitted, the size of the control is not
changed.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 ScreenLeft PIC S9(9) COMP-5.
01 ScreenTop PIC S9(9) COMP-5.
01 ScreenWidth PIC S9(9) COMP-5.
01 ScreenHeight PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Remember that values must be expressed in the current Scale
* Mode. Here we set the scale mode to pixels first.
MOVE 0 TO "ScaleMode" OF CmText1
* Use the optional ScreenWidth and ScreenHeight Parms to resize
* the control as well.
MOVE 10 TO ScreenLeft
MOVE 20 TO ScreenTop
MOVE 50 TO ScreenWidth
MOVE 20 TO ScreenHeight
INVOKE CmText1 "Move" USING ScreenLeft ScreenTop
ScreenWidth ScreenHeight
Backward compatibility Corresponds to setting a value to POW-POSITION.
method name:
306 Chapter 5. Methods
MoveForm Method
Description: Moves the form to the specified position.
The units are those defined in the ScaleMode property of the form.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I4 - Left S9(9) COMP-5
2. VT_I4 - Top S9(9) COMP-5
3. [VT_I4 - Width S9(9) COMP-5]
4. [VT_I4 - Height S9(9) COMP-5]
Description of Parameters: 1. Left: The new horizontal position for the top left corner of the form.
2. Top: The new vertical position for the top left corner of the form.
3. Width: The new width for the form.
4. Height: The new height for the form.
If Width and Height parameters are omitted, the size of form is not changed.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 ScreenLeft PIC S9(9) COMP-5.
01 ScreenTop PIC S9(9) COMP-5.
01 ScreenWidth PIC S9(9) COMP-5.
01 ScreenHeight PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Remember that values must be
* expressed in the current Scale
* Mode.
* Here we set the scale mode to
* pixels first
MOVE 0 TO "ScaleMode" OF CmText1
* Use the optional ScreenWidth and
* ScreenHeight Parms to
* resize the form as well
MOVE 10 TO ScreenLeft
MOVE 20 TO ScreenTop
MOVE 200 TO ScreenWidth
MOVE 200 TO ScreenHeight
INVOKE MainForm "MoveForm"
USING ScreenLeft
ScreenTop
ScreenWidth
ScreenHeight
Backward compatibility Corresponds to setting a value to POW-POSITION.
method name:
Chapter 5. Methods 307
NewBook Method
Description: Executes the Excel new command to create a new book.
Starts Excel if Excel is not running.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: [VT_I4 SheetIndex S9(9) COMP-5]
Description of Parameters: The index of the sheet to connect to within the Excel book. Data is
exchanged with this sheet, however, the sheet is not selected in Excel.
Each sheet has a tab in Excel (by default labeled "Sheet1", "Sheet2",
"Sheet3"). The index numbers the sheets from left to right 1, 2, 3...
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: WORKING-STORAGE SECTION.
01 ExcelSheetIndx PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE 2 To ExcelSheetIndx
INVOKE CmExcel1 "NewBook"
USING ExcelSheetIndex
RETURNING ReturnValue
Backward compatibility NEWEXCELSHEET
method name:
Backward compatibility None.
arguments:
308 Chapter 5. Methods
OpenBook Method
Description: Executes the Excel open command to open an existing book.
Starts Excel if Excel is not running.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: 1. VT_BSTR - BookName X(8192)
2. [VT_I4 - SheetIndex S9(9) COMP-5]
Description of Parameters: 1. BookName: The name of the Excel book to open.
2. SheetIndex: The index of the sheet to connect to within the Excel book.
Data is exchanged with this sheet, however, the sheet is not selected in
Excel.
Each sheet has a tab in Excel (by default labeled "Sheet1", "Sheet2",
"Sheet3"). The index numbers the sheets from left to right 1, 2, 3...
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: WORKING-STORAGE SECTION.
01 ExcelBookName PIC X(20).
01 ExcelSheetIndx PIC S9(9) COMP-5.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Opens the "my.xls" book and goes
* to page 2
MOVE "C:\my.xls" TO ExcelBookName
MOVE 2 TO ExcelSheetIndx
INVOKE CmExcel1 "OpenBook"
USING ExcelBookName
ExcelSheetIndx
RETURNING ReturnValue
Backward compatibility OPENEXCELSHEET
method name:
Backward compatibility X(260)
arguments:
Chapter 5. Methods 309
OpenDB Method
Description: Starts the data base connection.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion. Negative indicates an error.
Example: INVOKE CmDB1 "OpenDB" RETURNING ReturnValue
OpenDDE Method
Description: Opens the DDE conversation with the DDE server and starts the advise loop.
Its effect is the same as executing the InitiateDDE and AdviseDDE methods
successively.
It is necessary to call the OpenDDE method before conducting a
conversation with the DDE server. For example you can have a conversation
if you call the Execute and OpenDDE methods from the Opened event of the
form.
Used in controls: DDE
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion. Negative indicates an error.
Example: INVOKE CmDDE1 "OpenDDE" RETURNING ReturnValue
OpenDevice Method
Description: Opens the MCI device.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "OpenDevice"
OpenForm Method
Description: Opens (shows) a form in "Modeless" mode.
"Modeless" means that the parent form is active after opening the child
form.
It is different from the CallForm2 (CallForm) method in that control is
returned to the code immediately after opening the child form.
The child form cannot be re-opened until it is closed.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - FormName X(8192)
2. [VT_BSTR - DllName X(8192)
3. [VT_I4 - Cookie S9(9) COMP-5]
Description of Parameters: 1. FormName: The name of the form to be opened.
2. DllName: When the form is a DLL, defines the name of the DLL file
containing the form.
It should be omitted when the form is in the same DLL file, as specifying
the DLL name that contains the invoking form degrades performance.
3. Cookie: An integer that distinguishes the opened form.
It is set in a parameter of the CloseChild event when the opened form is
closed. If you omit it, the parameter value is zero.
Note that the order of parameters is different from the order of
OPENSHEET's parameters.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero indicates normal completion.
Non-zero indicates an error.
DLL Search Path: When the DllName Parameter does not contain the full path, PowerCOBOL
searches for the DLL in folders in the following order:
1. The folder containing the execution file.
2. The current folder.
3. The system folder of 32 bit Windows.
4. The system folder of 16 bit Windows.
5. The folder containing Windows.
6. The folders set in the PATH environment variable.
Chapter 5. Methods 311
Example: 1. To open a form called "Subform1" contained in the same DLL module you
would code:
WORKING-STORAGE SECTION.
01 Subform1-ID PIC S9(9) COMP-5
VALUE 1.
PROCEDURE DIVISION.
INVOKE POW-SELF "OpenForm"
USING "SubForm1"
Subform1-ID
SET Subform1-Open TO TRUE
Where Subform1-Open is a global item
2. To open a form called "Subform2" contained in a DLL called
"SubForm2.DLL" you would code:
WORKING-STORAGE SECTION.
01 Subform2-ID PIC S9(9) COMP-5
VALUE 2.
PROCEDURE DIVISION.
INVOKE POW-SELF "OpenForm"
USING "SubForm2"
"SubForm2.DLL"
Subform2-ID
Backward compatibility OPENSHEET
method name:
Backward compatibility 1. X(260) - DLL name
arguments: 2. X(14) - Sheet name
PauseAnimation Method
Description: Pauses the animation.
Used in controls: Animation
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmAnimation1 "PauseAnimation"
PauseDevice Method
Description: Pauses in playing the MCI device.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "PauseDevice"
PlayAnimation Method
Description: Starts the animation.
Used in controls: Animation
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmAnimation1 "PlayAnimation"
PlayDevice Method
Description: Starts the MCI device.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "PlayDevice"
PlaySound Method
Description: Plays the sound file specified in the Element property.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "PlaySound"
PokeData Method
Description: Sets data in the DDE server.
Used in controls: DDE
Used in objects: None.
Parameters: No OLE data types.
PokeData: A group item whose length is 8196 bytes.
Description of Parameters: PokeData has the following elementary items.
DataLength S9(9) COMP-5
The length of the data in the buffer.
DataArea X(8192)
The data to pass to the DDE server.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: Place this code in the Form's Opened method so that it establishes the DDE
connection and executes only once:
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
INVOKE CmDDE1 "Execute"
USING "Excel c:\exceldde97.xls"
POW-SWSHOWNORMAL
RETURNING ReturnValue
INVOKE CmDDE1 "OpenDDE"
RETURNING ReturnValue
PopupMenu Method
Description: Opens a floating popup menu.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_BSTR - MenuName X(8192)
2. [VT_I4 - PosX S9(9) COMP-5]
3. [VT_I4 - PosY S9(9) COMP-5]
Description of Parameters: MenuName: The name of Menu object
(Name property value)
PosX: The relative position (X coordinates) for the top left corner of the
floating popup menu. The units are defined in the ScaleMode property.
PosY: The relative position (Y coordinates) for the top left corner of the
floating popup menu. The units are defined in the ScaleMode property.
Return value: None.
Example: To display a pop-up menu at the point the mouse is clicked code, in the
MouseUp event:
INVOKE POW-SELF "PopupMenu"
USING "PopupMenuName"
Backward compatibility None.
method name:
Chapter 5. Methods 315
PrintForm Method
Description: Prints the form, including all controls whose Printable property is True, and
excluding all the controls whose Printable property is False or which are not
printable.
Used in controls: Print
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmPrint1 "PrintForm"
Backward compatibility None.
method name:
ProgressStep Method
Description: Adds the value of the Step property to the Value property.
Used in controls: ProgressIndicator
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmProgress1 "ProgressStep"
ReadFirstRecord Method
Description: Reads the first record.
CursorType property must be set to a value other than "0 -
SQL_CURSOR_FORWARD_ONLY".
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
1 indicates normal completion.
Zero means that the record does not exist.
Negative indicates an error.
Example: INVOKE CmDB1 "ReadFirstRecord"
RETURNING ReturnValue
Backward compatibility None.
method name:
316 Chapter 5. Methods
ReadLastRecord Method
Description: Reads the last record.
CursorType property must be set to a value other than "0 -
SQL_CURSOR_FORWARD_ONLY".
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
1 indicates normal completion.
Zero means that the record does not exist.
Negative indicates an error.
Example: INVOKE CmDB1 "ReadLastRecord" RETURNING ReturnValue
ReadNextRecord Method
Description: Reads the next record.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
1 indicates normal completion.
Zero means that the record does not exist.
Negative indicates an error.
Examples: INVOKE CmDB1 "ReadNextRecord" RETURNING ReturnValue
ReadPreviousRecord Method
Description: Reads the previous record. CursorType property must be set to a value other
than "0 - SQL_CURSOR_FORWARD_ONLY".
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
1 indicates normal completion.
Zero means that the record does not exist. Negative indicates an error.
Examples: INVOKE CmDB1 "ReadPreviousRecord" RETURNING ReturnValue
Refresh Method
Description: Forces a repainting of the control on the screen.
Painting of controls in Windows normally happens asynchronously.
Therefore, when you update a property, such as the Caption property, within
a PERFORM loop, the screen may not be updated immediately. Use this
method to force an immediate refresh.
Used in controls: All controls that can be displayed at execution time.
Used in objects: Form
Parameters: None.
Return value: None.
Example: INVOKE CmText1 "Refresh"
RequestData Method
Description: Acquires data from the DDE server.
The maximum length that can be acquired at a time is 1024 bytes. When
you acquire the data of 1024 bytes or more, you need to acquire it in 1024
byte chunks.
Used in controls: DDE
Used in objects: None.
Parameters: No OLE data types.
DDEData: A group item whose length is 1028 bytes.
Description of Parameters: DDEData has the following elementary items.
DataLength S9(9) COMP-5
The length of the data in the buffer. If the total data length is longer than a
single buffer can contain, use the DDEDataOffset property to track the data
over multiple calls.
1. DataArea X(1024)
The data from the DDE server.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: Place this code in the form's Opened method so that it establishes the DDE
connection and executes only once:
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
INVOKE CmDDE1 "Execute"
USING "Excel c:\exceldde97.xls"
POW-SWSHOWNORMAL
RETURNING ReturnValue
INVOKE CmDDE1 "OpenDDE"
RETURNING ReturnValue
318 Chapter 5. Methods
ResumeDevice Method
Description: Restarts playing the MCI device.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "ResumeDevice"
RewriteCurRecord Method
Description: Rewrites the current record.
ConcurrencyCursor property must be set to a value other than "1 -
SQL_CONCUR_READ_ONLY".
You cannot update a key field (as specified in the DBAccess page - "Other"
option).
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "RewriteCurRecord" RETURNING ReturnValue
RewriteRecord Method
Description: Updates the record defined by the value of the key field. (The key field is
specified in the DBAccess property page.)
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: See the RewriteRecord Example
Backward compatibility REWRITERECORD
method name:
Backward compatibility None.
arguments:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
*> Connect with the database.
*> The return value of the method is stored in ReturnValue.
INVOKE CmDb1 "OpenDB" RETURNING ReturnValue.
*> Process the return value.
:
*> Set "JOB_ID" to 500. (key field)
*> Set "FUNCTION" to "DRIVER".
320 Chapter 5. Methods
RollbackDB Method
Description: Rolls back updates in manual commit mode.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "RollbackDB" RETURNING ReturnValue
SaveAsBook Method
Description: Executes the Excel save as command to save the book.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: 1. VT_BSTR - BookName X(8192)
2. [VT_BOOL - DisplayDialog S9(4) COMP-5]
Description of Parameters: 1. BookName: The name to use when saving the book.
2. DisplayDialog: Specify whether to display the Save As dialog.
POW-TRUE: Display the Save As dialog.
POW-FALSE: Do not display the Save As dialog.
If omitted, the Save As dialog is displayed.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion. Negative indicates an error.
Example: WORKING-STORAGE SECTION.
01 ExcelBookName PIC X(20).
01 ReturnValue PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Saves the current Excel book as
* "my.xls"
MOVE "C:\my.xls" TO ExcelBookName
INVOKE CmExcel1 "SaveAsBook" USING ExcelBookName
RETURNING ReturnValue
Backward compatibility None.
method name:
SaveBook Method
Description: Execute the Excel save command to save the book.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmExcel1 "SaveBook" RETURNING ReturnValue
SaveFile Method
Description: Saves the contents of the control in the specified file.
ComboBox Saves the contents of the list box part in the specified file. Uses the file
format specified in the FileType property.
ListBox Saves the contents of the list box in the specified file.
TextBox Saves the contents of the Text property in the specified file.
Used in controls: ComboBox TextBox
ListBox
Used in objects: None.
Parameters: VT_BSTR - FileName X(8192)
Description of Parameters: The name of the file.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 FileName PIC X(20).
PROCEDURE DIVISION.
MOVE "C:\myfile.txt" TO FileName
INVOKE CmList1 "SaveFile" USING FileName
Backward compatibility SAVEFILE
method name:
Backward compatibility X(260)
arguments:
SelectCell Method
Description: Sets the focus on the specified cell.
Used in controls: Table
Used in objects: None.
Parameters: 1. VT_I4 - Row S9(9) COMP-5
2. VT_I4 - Column S9(9) COMP-5
Description of Parameters: 1. Row: The row number of the target cell.
2. Column: The column number of the target cell.
Return value: None.
Example: WORKING-STORAGE SECTION.
01 TableRow PIC S9(9) COMP-5.
01 TableColumn PIC S9(9) COMP-5.
PROCEDURE DIVISION.
* Select Table cell 2,3
MOVE 2 TO TableRow
MOVE 3 TO TableColumn
INVOKE CmTable1 "SelectCell"
USING TableRow TableColumn
Backward compatibility SELECTCELL
method name:
Backward compatibility 1. S9(4) COMP-5
arguments: 2. S9(4) COMP-5
Chapter 5. Methods 323
SelectRecords Method
Description: Selects the records to be processed in subsequent reads, based on the
condition set in the Condition property.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: See the SelectRecords Example
Backward compatibility SELECTRECORDS
method name:
Backward compatibility None.
arguments:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ReturnValue PIC S9(9) COMP-5.
01 WorkJOBID PIC S9(3).
01 WorkFUNCTION PIC X(30).
PROCEDURE DIVISION.
*> Connect with the database.
*> The return value of the method is stored in ReturnValue.
INVOKE CmDb1 "OpenDB" RETURNING ReturnValue.
*> Process the return value.
:
*> Set "JOB_ID" to 500. (key field); Set "FUNCTION" to "DRIVER".
MOVE 500 TO "JOB_ID" OF CmDb1.
MOVE "TAXI DRIVER" TO "FUNCTION" OF CmDb1.
*> Adds a record to the table.
*> The return value of the method is stored in ReturnValue.
INVOKE CmDb1 "WriteRecord" RETURNING ReturnValue.
*> Process the return value.
:
*> Sets the condition of the database.
MOVE "JOB_ID = 500" TO "Condition" OF CmDb1.
*> Selects records whose "JOB_ID" field is 500.
INVOKE CmDb1 "SelectRecords" RETURNING ReturnValue.
*> Process the return value.
:
*> Reads next record.
INVOKE CmDb1 "ReadNextRecord" RETURNING ReturnValue.
*> Process the return value.
:
*> Refers to the value of field.
*> WorkJOBID is set to 500 and WorkFUNCTION is set to "TAXI DRIVER".
MOVE "JOB_ID" OF CmDb1 TO WorkJOBID.
MOVE "FUNCTION" OF CmDb1 TO WorkFUNCTION.
:
*> Release the database connection.
INVOKE CmDb1 "CloseDB".
324 Chapter 5. Methods
SetAbort Method
Description: Notifies Microsoft Transaction Server that the transaction has been aborted.
Used in controls: MTS Support
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmViper1 "SetAbort"
SetComplete Method
Description: Notifies Microsoft Transaction Server that the transaction has been
completed.
Used in controls: MTS Support
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmViper1 "SetComplete"
SetFocus Method
Description: Sets the focus on the control.
It does not work when the Enabled or Visible property is False.
Used in controls: CheckBox Edit ListView Tab
ComboBox FileList OptionButton Table
CommandButton FolderList ScrollBar TextBox
Custom ListBox Slider TreeView
DriveList
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmText1 "SetFocus"
SetMCICommand Method
Description: Passes an MCI command to the MCI driver.
Used in controls: MCI
Used in objects: None.
Parameters: VT_BSTR - MCICommand X(8192)
Description of Parameters: The MCI command string.
Return value: VT_BSTR - ReturnValue X(8192)
The character string returned by the command.
Example: WORKING-STORAGE SECTION.
01 MCI-Chk-CD PIC X(28) VALUE
"status cdaudio media present".
01 CD-Received PIC X(256).
PROCEDURE DIVISION.
* This command checks to see if a
* CD player is available. "True"
* is returned in the CD-Received
* parameter if present, otherwise
* "False" is returned.
INVOKE CmMCI1 "SetMCICommand"
USING MCI-Chk-CD
RETURNING CD-Received
Backward compatibility None.
method name:
326 Chapter 5. Methods
SetPage Method
Description: Displays the Page Setup dialog allowing the user to configure page details
before printing.
Values set in the dialog update the following Print control properties:
BottomMargin PaperOrientation PrinterName Source
LeftMargin PaperType RightMargin TopMargin
Used in controls: Print
Used in objects: None.
Parameters: [VT_I4 DisableSetting S9(9) COMP-5]
Description of Parameters: Defines which of the features in the dialog to disable. If no parameter is
provided all features are enabled. The following constants can be used to set
the styling.
POW-DISABLEMARGINS : Margins
POW-DISABLEPRINTER : Printer setting
POW-DISABLEORIENTATION : Orientation
POW-DISABLEPAPER : Paper
POW-DISABLEPAGEPAINTING : Layout
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means the OK button was pushed.
POW-FALSE means the Cancel button was pushed.
Example: INVOKE CmPrint1 "SetPage"
USING DialogStyle
RETURNING ReturnValue
Backward compatibility None.
method name:
SetPrinter Method
Description: Displays the Print Setup dialog allowing the user to configure printer details
before printing.
Values set in the dialog update the following Print control properties.
PaperOrientation PaperType PrinterName Source
Used in controls: Print
Used in objects: None.
Parameters: None.
Return value: VT_BOOL - ReturnValue S9(4) COMP-5
POW-TRUE means the OK button was pushed.
POW-FALSE means the Cancel button was pushed.
Example: INVOKE CmPrint "SetPrinter"
RETURNING ReturnValue
Backward compatibility None.
method name:
Chapter 5. Methods 327
ShowForm Method
Description: Displays the specified form.
Used in controls: None.
Used in objects: Form
Parameters: VT_I4 - WindowState S9(9) COMP-5
Description of Parameters: The state in which the form should be displayed.
POW-SWHIDE: Puts the form in the background - it does not display a
window.
POW-SWSHOWNORMAL: Displays the form using its default window size.
POW-SWSHOWMINIMIZED: Minimizes the form making it active.
POW-SWMINIMIZED: Minimizes the form making it inactive.
POW-SWSHOWMINNOACTIVE: Minimizes the form. The active window is
unchanged (keeps the focus).
POW-SWSHOWMAXIMIZED: Maximizes the form making it active.
Return value: None.
Example: INVOKE POW-SELF "ShowForm" USING POW-SWSHOWNORMAL
INVOKE CmText1 "SetFocus"
Backward compatibility SHOWSHEET
method name:
Backward compatibility S9(4) COMP-5
arguments:
Start Method
Description: Starts Excel.
Used in controls: ExcelConnection
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmExcel1 "Start"
RETURNING ReturnValue
Backward compatibility None.
method name:
328 Chapter 5. Methods
StartEdit Method
Description: Puts the control into edit mode.
It works even when the LabelEdit property is False.
Invoking this method generates an Edit event.
Used in controls: ListView TreeView
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmListView1 "StartEdit"
StopDevice Method
Description: Stops playing the MCI device.
Used in controls: MCI
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmMCI1 "StopDevice"
TerminateDDE Method
Description: Closes the DDE conversation with the DDE server.
Used in controls: DDE
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmDDE1 "TerminateDDE"
ThruEvents Method
Description: Compels window messages, which are waiting for an event procedure to
finish, to execute before the event procedure finishes.
For example, if you code an event procedure "A" that takes a long time to
execute, and use a Timer control to update the form in the Timer event, the
Timer event will wait for the procedure "A" to conclude.
If you invoke the ThruEvents method at intervals from the procedure "A", the
Timer events work smoothly.
Refer to the ThruEvents Example for details.
Caution: The ThruEvents method can cause unexpected results because of
timing or procedure coding errors. Refer to Unexpected Results when using
the ThruEvents Method for more details.
Use this method with care.
Used in controls: None.
Used in objects: Form
Parameters: None.
Return value: None.
Example: See the ThruEvents Example
Backward compatibility None.
method name:
If the click event is executing, exit program to prevent(restrict) the event nesting
Click event of a CommandButton, which invokes the ThruEvents Method
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I PIC S9(9) COMP-5.
PROCEDURE DIVISION.
IF IS-RUNNING THEN
EXIT PROGRAM *> Exit to prevent nesting of the event
END-IF
MOVE 1 TO RUNNING-FLAG. *> Sets the executing flag
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 1000000
MOVE I TO "Caption" OF COUNTER *> Display counter
IF FUNCTION MOD (I 1000) = 0 THEN
INVOKE POW-SELF "ThruEvents" *> Executes any waiting event procedures
IF NOT IS-RUNNING THEN *> Exits if the cancel button is clicked
330 Chapter 5. Methods
EXIT PERFORM
END-IF
END-IF
END-PERFORM
MOVE 0 TO RUNNING-FLAG. *> Releases the executing flag
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
MOVE 0 TO RUNNING-FLAG. *> Sets the executing flag to 0
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
LINKAGE SECTION.
01 POW-CANCEL PIC S9(4) COMP-5.
PROCEDURE DIVISION USING POW-CANCEL.
IF IS-RUNNING THEN
MOVE POW-TRUE TO POW-CANCEL
END-IF
First event:
Second event:
Third event:
Explanation:
When ThruEvents is invoked from the first event, the execution of the first event
pauses while the other events in the queue are executed. So the second event starts,
and similarly pauses while the third event starts. After the third event has paused for
any other events, its AddString method is executed – adding "Rose" to the list. The
third event completes so the second event can now continue and adds "Ken" to the
list. The second event completes so the first event can continue and adds "Tom" to
the list.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WK-COUNT PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE 0 TO WK-COUNT.
PERFORM 1000000 TIMES
ADD 1 TO WK-COUNT
IF FUNCTION MOD (WK-COUNT 1000) = 0 THEN
INVOKE POW-SELF "ThruEvents"
END-IF
END-PERFORM.
MOVE WK-COUNT TO "Text" OF TEXTBOX1.
Explanation:
Suppose you make the second click when WK-COUNT is at 300,000 in the first click
event. The ThruEvents method pauses the first click execution and the code starts
executing again for the second click. If you do not click again, the second click
execution proceeds until WK-COUNT is 1,000,000 and control returns to the
execution for the first click. However, with the ScriptLanguage property set to "0-
COBOL85 Language Mode", the two events use the same data area for WK-COUNT.
Therefore the first event continues adding to WK-COUNT, but WK-COUNT has
jumped from 300,000 to 1,000,000. The first event executes another 700,000
iterations of the PERFORM statement, so WK-COUNT ends up with the value
1,700,000.
If the ScriptLanguage property is set to "1-00COBOL Language Mode" each event
invocation uses a different data area for WK-COUNT and each click takes WK-COUNT
to 1,000,000.
UnadviseDDE Method
Description: Ends the advise loop with the DDE server.
Used in controls: DDE
Used in objects: None.
Parameters: None.
Return value: None.
Example: INVOKE CmDDE1 "UnadviseDDE"
UpdateRecord Method
Description: Updates the field that is bound to the property.
Used in controls: Custom Edit
Used in objects: DataBinding
Parameters: None.
Return value: None.
Example: See the UpdateRecord method examples.
Backward compatibility None.
method name:
Example 2:
For a field that is bound to the Text property of the custom control "Custom2"
INVOKE "Item"("Text") OF "DataBindings"
OF Custom2 "UpdateRecord"
Example 3:
For data fields that are bound to several properties of the custom control "Custom3"
WORKING-STORAGE SECTION.
01 PROPERTY-COUNT PIC S9(9) COMP-5.
01 IDX PIC S9(9) COMP-5.
PROCEDURE DIVISION.
MOVE "Count" OF Custom3 TO PROPERTY-COUNT
PERFORM VARYING IDX FROM 1 BY 1 UNTIL I > PROPERTY-COUNT
INVOKE "Item"(IDX) OF "DataBindings"
OF Custom3 "UpdateRecord"
END PERFORM
and Move methods of the Recordset object (as in 2, these methods are not
PowerCOBOL methods, but can be invoked from PowerCOBOL code).
4. The update can be canceled by invoking the CancelUpdate method if the copy
buffer has not been written into the database (again this method is invoked
using the syntax described in point 2 above).
WriteRecord Method
Description: Adds a record to the table.
Used in controls: DB Access
Used in objects: None.
Parameters: None.
Return value: VT_I4 - ReturnValue S9(9) COMP-5
Zero or greater indicates normal completion.
Negative indicates an error.
Example: INVOKE CmDB1 "WriteRecord"
RETURNING ReturnValue
Backward compatibility WRITERECORD
method name:
Backward compatibility None.
arguments:
Chapter 5. Methods 335
ZOrder Method
Description: Changes the Z-order, the order in which controls are painted (in the "Z"
dimension - perpendicular to the surface of the screen).
It does not affect the TabIndex property.
Used in controls: Animation FileList ListBox Slider
CheckBox FolderList ListView StaticText
ComboBox Frame MCI Tab
CommandButton Graph OptionButton Table
Custom GroupBox ProgressIndicator TextBox
DriveList Image ScrollBar Toolbar
Edit Label Shape TreeView
Used in objects: None.
Parameters: [VT_I2 - ZorderPos S9(4) COMP-5]
Description of Parameters The new position of the control in the Z-dimension.
(with constants): 0: Puts the control at the top of the order.
(POW-ZORDER-FRONT)
1: Puts the control at the bottom of the order.
(POW-ZORDER-BACK)
If the parameter is omitted PowerCOBOL puts the control at the top of the
order.
Return value: None.
Example: To ensure an image, called "CmImage1", is displayed behind all other
controls on your form, code:
WORKING-STORAGE SECTION.
01 ZOrder-Bottom PIC S9(4) COMP-5
VALUE 1.
PROCEDURE DIVISION.
INVOKE CmImage1 "ZOrder"
USING ZOrder-Bottom
Backward compatibility None.
method name:
336 Chapter 5. Methods
Chapter 6. Events
This chapter describes all of the PowerCOBOL events.
BeforeClick Event
Description: The purpose of this event is to let you verify the input to a tab page before
switching to another page. If there are errors you can maintain the focus on
the current page.
The event is generated when a tab or Tab control button is clicked - before
the Click event.
If PageCancel is set to True, the Tab control does not switch to the new
page.
See the BeforeClick Sample Code.
Used in controls: Tab
Used in objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - OldPageIndex S9(9) COMP-5
3. VT_BOOL - PageCancel S9(4) COMP-5
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. OldPageIndex: Number of the tab page that is currently displayed.
3. PageCancel: Determines whether the tab control switches to the new
selected page. If you set PageCancel to POW-TRUE, the page is not
switched. If you set it to POW-FALSE, the page is switched.
ButtonClick Event
Description: Generated when a button on the Toolbar control is clicked.
Used in controls: Toolbar
Used in objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - ButtonIndex S9(9) COMP-5
Description of parameters: 1. Index: When the control is part of an array, Index gives the control's
index in the array.
2. ButtonIndex: The index of the button clicked on.
Change Event
Description: Generated when:
ComboBox Text in the text box changes if the Style property is "0 - Simple" or "1 -
DropDown".
Edit Text in the control changes.
FolderList Another folder is selected and the current folder changes.
Generated after the SelChange event.
Image Displayed image changes.
ProgressIndicator Value property changes.
ScrollBar Scrollbar position changes.
Slider Slider pointer position changes.
StaticText Displayed text changes.
TextBox If the EditableLabel property is False, a Change event is generated every
time the user presses a character key.
If the EditableLabel property is True, the Change event is only generated
when the user presses the ENTER key.
Used in controls: ComboBox Image ScrollBar StaticText
Edit ProgressIndicator Slider TextBox
FolderList
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
340 Chapter 6. Events
Click Event
Description: Generated when the left mouse button is clicked on the control or an
equivalent event occurs.
CheckBox Mouse left button is clicked on the control.
Space bar is pressed when the control has focus.
CommandButton 1. Mouse left button is clicked on the control.
2. Space bar is pressed when the control has focus.
3. ENTER key is pressed when the control has focus.
4. Button is the default (Default property is True), and the focus is not in a
control that processes the ENTER key, and ENTER key is pressed.
5. Function key set in the CommandButton property page is pressed.
6. When Cancel is True, and the focus is not in a control that processes the
ESC key, and ESC key is pressed.
CloseChild Event
Description: Generated when a child form, opened with the OpenForm or CallForm2
(CallForm) method, is closed.
Used in controls: None.
Used in objects: Form
Parameters: VT_I4 - Cookie S9(9) COMP-5
Description of parameters: Cookie: Value set in the third parameter ("Cookie") of the OpenForm or
CallForm method.
Closed Event
Description: Generated when a form is closed.
Notes Do not invoke the OpenForm, CallForm2 (CallForm) and CloseForm methods
in the Closed event.
Used in controls: None.
Used in objects: Form
Parameters: None.
Collapse Event
Description: Generated when a Node object in the TreeView control is collapsed.
Used in controls: TreeView
Used in objects: None.
Parameters: 1.[VT_I4 - Index S9(9) COMP-5]
2. VT_DISPATCH - Node OBJECT REFERENCE POW-CNODE
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. Node: Pointer to the Node object being collapsed.
ColumnClick Event
Description: Generated when the LVStyle property is "3 - Report", and the heading of a
column in the ListView control is clicked.
Used in controls: ListView
Used in objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - ColumnIndex S9(9) COMP-5
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. ColumnIndex: The index of the Column object that was clicked.
342 Chapter 6. Events
DblClick Event
Description: Generated when the mouse left button is double-clicked as follows.
ComboBox The Style property is "0 - Simple" and an item in the list box is double-
clicked.
FileList An item in the list box is double-clicked. The event can obtain the selected
file from the SelString property of the control.
ListBox An item in the list box is double-clicked.
Others The control or form is double-clicked.
Used in controls: Animation Graph ListView Table
ComboBox GroupBox MCI TextBox
FileList Image OptionButton TreeView
Frame ListBox StaticText
Used in objects: Form
Parameters:
Form and None.
GroupBox
Others [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
DDEChange Event
Description: Generated when data in the DDE server is updated.
The length of the data received from the DDE server is set in the
DDEDataLength property.
The updated data is contained in the DDEData property.
Used in controls: DDE
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Chapter 6. Events 343
DropDown Event
Description: Generated when a dropdown button is clicked.
It is only generated when the Style property of the clicked button is "4 -
DropDownButton".
Used in controls: Toolbar
Used in objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - ButtonIndex S9(9) COMP-5
3. VT_I4 - PosX S9(9) COMP-5
4. VT_I4 - PosY S9(9) COMP-5
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. ButtonIndex: Index of the clicked button.
3. PowX: The horizontal coordinate of the bottom-left corner of the clicked
button.
The ScaleMode property of the Toolbar control determines the units.
4. PowY: The vertical coordinate of the bottom-left corner of the clicked
button.
The ScaleMode property of the Toolbar control determines the units.
Edit Event
Description: Generated when the control enters the edit state.
The event is generated after the GotFocus event.
ComboBox Generated only when the Style property is "0 - Simple" or "1 - DropDown".
You can select whether the Edit event is generated in the ComboBox
property page.
Edit Generated when the control enters the edit state if EditWhenGotFocus
property is True.
TextBox You can select whether the Edit event is generated in the TextBox property
page.
Used in controls: ComboBox ListView TextBox TreeView
Edit Table
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
344 Chapter 6. Events
EndAnimation Event
Description: Generated when the last frame of an animation has played.
Used in controls: Animation
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
EndOfRecordset Event
Description: Generated when there is an attempt to move to a row past the end of the
Recordset.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_BOOL - MoreData S9(4) COMP-5
3. VT_I4 - adStatus S9(9) COMP-5
4. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. MoreData: If the value is set to True, it indicates more rows have been
added to the recordset.
3. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSERRORSOCCURRED:
Indicates that the operation that caused the event failed due to an error
or errors.
POW-ADODB-ADSTATUSOK:
Indicates that the operation that caused the event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT:
Requests that further events of the type that caused this event to be
generated should not be generated.
4. pRecordset: Indicates a pointer to the recordset object, for which this
event is generated.
Details: Consult the ADO documentation for details.
Chapter 6. Events 345
EndScroll Event
Description: Generated when the mouse button or a key is released after controlling the
slider or scroll bar.
Used in controls: ScrollBar Slider
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Expand Event
Description: Generated when a Node object in the TreeView control is expanded.
The event is generated after the Click and DblClick events.
Used in controls: TreeView
Used in objects: None.
Parameters: 1.[VT_I4 - Index S9(9) COMP-5]
2. VT_DISPATCH - Node
OBJECT REFERENCE POW-CNODE
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. Node: Pointer to the Node object that is being expanded.
346 Chapter 6. Events
FieldChangeComplete Event
Description: Generated after the value of one or more ADO field objects has changed.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - Reserved1 S9(9) COMP-5
3. VT_I4 - Reserved2 S9(9) COMP-5
4. VT_DISPATCH – pError OBJECT REFERENCE POW-COBJECT
5. VT_I4 - adStatus S9(9) COMP-5
6. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. Reserved1: Do not use this parameter. It is reserved for future use.
3. Reserved2: Do not use this parameter. It is reserved for future use.
4. pError: Indicates an ADO error object. It describes the error that occurred
if the value of adStatus parameter is
POW-ADODB-ADSTATUSERRORSOCCURRED, otherwise it is not set.
5. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSERRORSOCCURRED:
Indicates that the operation that caused the event failed due to an error
or errors.
POW-ADODB-ADSTATUSOK:
Indicates that the operation that caused the event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT:
Requests that further events of the type that caused this event to be
generated should not be generated.
6. pRecordset: Indicates a pointer to the recordset object, for which this
event is generated.
Details: Consult the ADO documentation for details.
GotFocus Event
Description: Generated when the control receives the focus.
Used in controls: CheckBox Edit ListView Tab
ComboBox FileList OptionButton Table
CommandButton FolderList ScrollBar TextBox
Custom ListBox Slider TreeView
DriveList
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Chapter 6. Events 347
ItemClick Event
Description: Generated when a ListItem object in the ListView control is clicked.
The event is generated before the Click event.
You can identify the clicked ListItem object by referring to the ListItem
parameter.
Used in controls: ListView
Used in objects: None.
Parameters: 1.[VT_I4 - Index S9(9) COMP-5]
2. VT_DISPATCH – ListItem OBJECT REFERENCE POW-CLISTITEM
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. ListItem: Pointer to the ListItem object that is being clicked.
KeyDown Event
Description: Generated when a key is pressed and passed to the control that has the
focus.
The KeyPress and KeyUp events are usually generated after the KeyDown
event.
If a key is pressed and kept depressed, multiple KeyDown and KeyPress
events are generated before a KeyUp event.
Note that if you press a toggle key (e.g. Caps Lock, Num Lock):
The order of events may be changed.
One of these events may not be generated.
To support special keystrokes, such as short-cuts, on the form, see the
PreKeyDown event.
TreeView and KeyDown events are not generated when a label is being edited.
ListView
Others Event is not generated in the following cases:
a) When the Tab key is pressed.
b) When an access (mnemonic) key is pressed.
c) When an arrow key is pressed.
Note that if a control, which uses arrow keys (e.g. ComboBox control,
ScrollBar control), has the focus, the KeyDown and KeyUp events are
generated.
d) When a function key, which was defined in the CommandButton
property page, is pressed.
e) When a short-cut key, which was defined in the MenuItem property
page, is pressed.
f) If the form contains the following controls, when the ENTER key is
pressed:
- A control, which has focus, does not use ENTER key
(e.g. Table control, a TextBox control whose MultiLine property is True,
use the ENTER key.)
- A CommandButton control, whose Default property is True, has the
focus.
348 Chapter 6. Events
KeyPress Event
Description: Generated when a character key is pressed and passed to the control that
has the focus.
The event is not generated for non-character keys such as the function keys
and the shift keys.
The KeyPress and Key events are usually generated after the KeyDown
event.
If a key is pressed, and kept depressed, multiple KeyDown and KeyPress
events are generated.
To support special keystrokes, such as short-cuts, on the form, see the
PreKeyUp event.
TreeView and KeyDown events are not generated when a label is being edited.
ListView
Others Event is not generated in the following cases:
a) When the Tab key is pressed.
b) When an access (mnemonic) key is pressed.
c) If the form contains the following controls, when the ENTER key is
pressed:
- The control that has focus does not use ENTER key
(e.g. Table control, a TextBox control whose MultiLine property is True,
use the ENTER key.)
- A CommandButton control, whose Default property is True, has the
focus.
d) If there are the following controls on the form, when ESCAPE key is
pressed:
- The control that has focus does not use ESCAPE key.
- CommandButton control, whose Cancel property is True.
Note that, if the KeyAscii parameter of the PreKeyPress event of the Form
object is set to another character code just before the KeyPress event is
generated, the KeyAscii parameter of the KeyPress event is the character
code that was set in the PreKeyPress event.
Used in controls: CheckBox Edit ListView Tab
ComboBox FileList OptionButton Table
CommandButton FolderList ScrollBar TextBox
DriveList ListBox Slider TreeView
Used in objects: Form
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I2 – KeyAscii S9(4) COMP-5
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. KeyAscii: The ASCII code of the key that was pressed. See Key Code
Constants for details. You can only use the constants POW-KEY-0 to
POW-KEY-9 and POW-KEY-A to POW-KEY-Z in the list.
350 Chapter 6. Events
KeyUp Event
Description: Generated when a key is released and passed to the control that has the
focus.
The KeyPress and KeyUp events are usually generated after the KeyDown
event.
If a key is pressed and kept depressed, multiple KeyDown and KeyPress
events are generated before a KeyUp event.
Note that if you pressed a toggle key (e.g. Caps Lock, Num Lock):
The order of events may be changed.
One of these events may not be generated.
To support special keystrokes, such as short-cuts, on the form, see the
PreKeyPress event.
TreeView and KeyDown events are not generated when a label is being edited.
ListView
Others Event is not generated in the following cases:
a) When the Tab key is pressed.
b) When an access (mnemonic) key is pressed.
c) When an arrow key is pressed.
Note that if a control, which uses direction keys (e.g. ComboBox control,
ScrollBar control), has the focus, the KeyDown and KeyUp events are
generated.
d) When a function key, which was defined in the CommandButton
property page, is pressed.
e) When a short-cut key, which was defined in the MenuItem property
page, is pressed.
LostFocus Event
Description: Generated immediately after the control loses focus.
Used in controls: CheckBox Edit ListView Tab
ComboBox FileList OptionButton Table
CommandButton FolderList ScrollBar TextBox
Custom ListBox Slider TreeView
DriveList
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
MouseDown Event
Description: Generated when a mouse button is depressed when the mouse pointer is
over the control.
The Click and DblClick events are generated after the MouseDown and
MouseUp events.
The control that receives the MouseDown event continues to receive
MouseMove events until the corresponding MouseUp event - whether or not
the mouse remains over the control.
ComboBox Mouse events (e.g. Click, MouseDown etc.) are not generated when the
Style property is "1 - DropDown" or "2 - DropDownList", and the drop down
list is displayed.
DriveList Mouse events (e.g. Click, MouseDown etc.) are not generated when the drop
down list is displayed.
TreeView and Mouse events (e.g. Click, MouseDown etc.) are not generated when a label
ListView is being edited.
MouseMove Event
Description: Generated when the mouse pointer is moved over the control.
The control that receives the MouseDown event continues to receive
MouseMove events until the corresponding MouseUp event - whether or not
the mouse remains over the control.
ComboBox Mouse events (e.g. Click, MouseDown etc.) are not generated when the
Style property is "1 - DropDown" or "2 - DropDownList", and the drop down
list is displayed.
DriveList Mouse events (e.g. Click, MouseDown etc.) are not generated when the drop
down list is displayed.
TreeView and Mouse events (e.g. Click, MouseDown etc.) are not generated when a label
ListView is being edited.
3. PosX: The horizontal coordinate of the mouse position relative to the top
left corner of the control. The ScaleMode property of the containing
control determines the units.
4. PosY: The vertical coordinate of the mouse position relative to the top
left corner of the control. The ScaleMode property of the containing
control determines the units.
Others 1. Index: When the control is part of an array, Index contains the control's
index in the array.
The descriptions of the other parameters (from 2 to 5) are the same as
"Form and GroupBox".
MouseUp Event
Description: Generated when a mouse button is released.
The Click and DblClick events are generated after the MouseDown and
MouseUp events.
The control that receives the MouseDown event continues to receive
MouseMove events until the corresponding MouseUp event - whether or not
the mouse remains over the control.
Note that if the focus changes, or if the active window changes (e.g. Alt +
Tab key pressed), the MouseUp event may not be generated.
ComboBox The event is generated when the Style property is "1 - DropDown" or "2 -
DropDownList", and the drop down list is displayed, and the menu button is
clicked (to hide the drop down list).
DriveList The event is generated when the control loses focus and when the drop
down list is displayed, and the menu button is clicked (to hide the drop down
list).
TreeView and Mouse events (e.g. Click, MouseDown etc.) are not generated when a label
ListView is being edited.
Description of parameters
(with constants):
Form and 1. MouseButton: Bit mask settings indicate the button(s) released.
GroupBox Numbering the bits 1 to 8, from least significant to most significant, the
bit mapping is:
1 - Left button (POW-MOUSE-LBUTTON)
2 - Right button (POW-MOUSE-RBUTTON)
3 - Middle button (POW-MOUSE-MBUTTON)
2. ShiftState: Bit mask settings indicate the state of each of the shift keys -
Shift, Ctrl and ALT. Numbering the bits 1 to 8, from least significant to
most significant, the bit mapping is:
1 - Shift key (POW-SHIFTSTATE-SHIFT)
2 - Ctrl key (POW-SHIFTSTATE-CTRL)
3 - Alt key (POW-SHIFTSTATE-ALT)
For example if the parameter has a value of 7 (binary 00000111), this
indicates that the Shift, Ctl and Alt keys are depressed.
3. PosX: The horizontal coordinate of the mouse position relative to the top
left corner of the control. The ScaleMode property of the containing
control determines the units.
4. PosY: The vertical coordinate of the mouse position relative to the top
left corner of the control. The ScaleMode property of the containing
control determines the units.
Others 1. Index: When the control is part of an array, Index contains the control's
index in the array.
The descriptions of the other parameters (from 2 to 5) are the same as
"Form and GroupBox".
MoveComplete Event
Description: Generated after the current position in the ADO recordset object changes.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - adReason S9(9) COMP-5
3. VT_DISPATCH – pError OBJECT REFERENCE POW-COBJECT
4. VT_I4 - adStatus S9(9) COMP-5
5. VT_DISPATCH – pRecordset OBJECT REFERENCE POW-COBJECT
Description of 1. Index: When the control is part of an array, Index contains the control's
parameters: index in the array.
2. adReason: Indicates the reason for this event as follows:
POW-ADODB-ADRSNMOVEFIRST: An operation moved the record pointer
to the first record in the ADO recordset object.
POW-ADODB-ADRSNMOVELAST: An operation moved the record pointer
to the last record in the ADO recordset object.
POW-ADODB-ADRSNMOVENEXT: An operation moved the record pointer
to the next record in the ADO recordset object.
POW-ADODB-ADRSNMOVEPREVIOUS: An operation moved the record
pointer to the previous record in the ADO recordset object.
POW-ADODB-ADRSNMOVE: An operation moved the record pointer within
the ADO recordset object.
356 Chapter 6. Events
NodeClick Event
Description: Generated when a Node object is clicked.
The event is generated before the Click event.
Used in controls: TreeView
Used in objects: None.
Parameters: 1.[VT_I4 - Index S9(9) COMP-5]
2. VT_DISPATCH Node OBJECT REFERENCE POW-CNODE
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. Node: Pointer to the Node object that was clicked.
Opened Event
Description: Generated when a form is opened.
Used in controls: None.
Used in objects: Form
Parameters: None.
PathChange Event
Description: Generated when the current folder is changed.
Used in controls: FileList
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Chapter 6. Events 357
PatternChange Event
Description: Generated when the Pattern property (filename filter containing wild card) is
changed.
Used in controls: FileList
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
PowerBroadcast Event
Description: Generated when an event related to the system's power management is
generated. This event is used when you execute the application on hardware
or Windows systems that support ACPI (Advanced Configuration and Power
Interface) or APM (Advanced Power Management).
For example, POW-PBT-APMQUERYSUSPEND (see parameters below) is
generated when the system is preparing to suspend. If your application is in
a state in which you would rather the system did not suspend, you can
request that the suspension does not happen.
The PowerBroadcast event is not generated when the form is used as an
ActiveX control pasted into another form.
Note: System power management may be different on each operating
system and hardware platform. For example, the timing of this event may be
different in each environment. Therefore you are advised only to use this
event once you have a good understanding of the power management on
your target platforms.
Refer to the operating system and hardware manuals for details of power
management.
The topic "Power Management" under "Platform SDK" in the MSDN
(Microsoft Developer Network) contains details of the events.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I2 - Event S9(4) COMP-5
2. VT_I4 - Data S9(9) COMP-5
3. VT_BOOL - Grant S9(4) COMP-5
Description of parameters: 1. Event:
The value defines the event generated by the system. Possible values are:
- POW-PBT-APMBATTERYLOW Battery power is low.
- POW-PBT-APMOEMEVENT OEM-defined event occurred.
- POW-PBT-APMPOWERSTATUSCHANGE Power status has changed.
- POW-PBT-APMQUERYSUSPEND Request for permission to suspend.
- POW-PBT-APMQUERYSUSPENDFAILED Suspension request denied.
- POW-PBT-APMRESUMEAUTOMATIC Operation resuming
automatically after event.
- POW-PBT-APMRESUMECRITICAL Operation resuming after critical
suspension.
- POW-PBT-APMRESUMESUSPEND Operation resuming after suspension.
358 Chapter 6. Events
PreKeyDown Event
Description: Generated when a key is pressed before the KeyDown event is passed to the
control that has the focus.
The PreKeyDown, PreKeyPress, and PreKeyUp events enable you to take
action on special keys, such as short-cut keys (e.g. Ctrl + D).
If no control has the focus then the PreKeyDown event is not generated -
the Form only receives the KeyDown event.
The PreKeyDown event is generated before the KeyDown event, and hence
usually before the PreKeyPress, KeyPress, PreKeyUp, and KeyUp events.
If a key is pressed and kept depressed, multiple PreKeyDown, KeyDown,
PreKeyPress and KeyPress events are generated before the PreKeyUp and
KeyUp events.
Note that if you press a toggle key (e.g. Caps Lock, Num Lock):
• The order of events may be changed.
• One of these events may not be generated.
If the active window is changed in the PreKeyDown event, like a message
box displayed by DisplayMessage, the value of the ShiftState parameter in
the next event (such as KeyDown or CommandButton Click) is different from
the key you input. For example,
1. In the PreKeyDown event, a message box is displayed when it
recognizes that you pressed the [Shift+F5] key. Then, in the KeyDown
event, the ShiftState parameter is zero unless you keep pressing the
[Shift] key at the same time as pushing a button that closes the
message box.
2. Suppose that a CommandButton is operated by the [F5] key and a
message box is displayed in the PreKeyDown event when you press the
[Shift+F5] key. The Click event of the CommandButton is generated
unless you are pressing the [Shift] key when you push one of the
buttons that closes the message box.
3. Similarly, suppose the CommandButton is operated by the [Shift+F5]
key and a message box is displayed in the PreKeyDown event when you
press the [Shift+F5] key. The Click event of the CommandButton is NOT
generated unless you keep pressing the [Shift] key when you push one
of the buttons to close the message box.
Chapter 6. Events 359
PreKeyPress Event
Description: Generated when a character key is pressed before the KeyPress event is
passed to the control that has the focus.
The PreKeyDown, PreKeyPress, and PreKeyUp events enable you to take
action on special keys, such as short-cut keys (e.g. Ctrl + D).
If no control has the focus then the PreKeyPress event is not generated - the
Form only receives the KeyPress event.
The PreKeyPress event is generated before the KeyPress event, and hence
usually before PreKeyUp and KeyUp events.
If a key is pressed and kept depressed, multiple PreKeyDown, KeyDown,
PreKeyPress and KeyPress events are generated before the PreKeyUp and
KeyUp events.
Used in controls: None.
Used in objects: Form
Parameters: VT_I2 - KeyAscii S9(4) COMP-5
Description of parameters: KeyAscii: The ASCII code of the key that was pressed. See Key Code
Constants for details. You can only use the constants POW-KEY-0 to POW-
KEY-9 and POW-KEY-A to POW-KEY-Z in the list.
360 Chapter 6. Events
PreKeyUp Event
Description: Generated when a key is released before the KeyUpt event is passed to the
control that has the focus.
The PreKeyDown, PreKeyPress, and PreKeyUp events enable you to take
action on special keys, such as short-cut keys (e.g. Ctrl + D).
If no control has the focus then the PreKeyUp event is not generated - the
Form only receives the KeyUp event.
If a key is pressed and kept depressed, multiple PreKeyDown, KeyDown,
PreKeyPress and KeyPress events are generated before the PreKeyUp and
KeyUp events.
Note that if you press a toggle key (e.g. Caps Lock, Num Lock):
• The order of events may be changed.
• One of these events may not be generated.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I2 - KeyCode S9(4) COMP-5
2. VT_I2 - ShiftState S9(4) COMP-5
Description of parameters 1. KeyCode: The key code that was pressed. See Key Code Constants for
(with constants): details of key codes.
2. ShiftState: Bit mask settings indicate the state of each of the shift keys -
Shift, Ctrl and ALT. Numbering the bits 1 to 8, from least significant to
most significant, the bit mapping is:
1 - Shift key (POW-SHIFTSTATE-SHIFT)
2 - Ctrl key (POW-SHIFTSTATE-CTRL)
3 - Alt key (POW-SHIFTSTATE-ALT)
For example if the parameter has a value of 3 (binary 00000011), this
indicates that the Shift and Ctl keys are depressed.
Chapter 6. Events 361
QueryClose Event
Description: Generated immediately before the closing process - before the Closed event.
Used in controls: None.
Used in objects: Form
Parameters: VT_BOOL - CloseCancel S9(4) COMP-5
Description of parameters: CloseCancel: Determines whether the Closed event will happen:
If set to POW-TRUE, the Closed event does not occur (i.e. Closed event is
canceled.)
If set to POW-FALSE, the Closed event does occur.
RecordChangeComplete Event
Description: Generated after one or more records change.
Used in controls: ADODataSourcel
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - adReason S9(9) COMP-5
3. VT_DISPATCH - pError
OBJECT REFERENCE POW-COBJECT
4. VT_I4 - adStatus S9(9) COMP-5
5. VT_I4 - cRecords S9(9) COMP-5
6. VT_DISPATCH - pRecordset
OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. adReason: Indicates the reason for this event as follows:
POW-ADODB-ADRSNADDNEW: An operation added a new record.
POW-ADODB-ADRSNDELETE: An operation deleted a record.
POW-ADODB-ADRSNUPDATE: An operation updated an existing record.
POW-ADODB-ADRSNUNDOUPDATE: An operation reversed the update of
a record.
POW-ADODB-ADRSNUNDOADDNEW: An operation reversed the addition
of a new record.
POW-ADODB-ADRSNUNDODELETE: An operation reversed the deletion of
a record.
POW-ADODB-ADRSNFIRSTCHANGE: An operation made the first change
to a record.
3. pError: Indicates an ADO error object. It describes the error that occurred
if the value of adStatus parameter is
POW-ADODB-ADSTATUSERRORSOCCURRED;
otherwise it is not set.
4. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSERRORSOCCURRED: Indicates that the operation
that caused the event failed due to an error or errors.
POW-ADODB-ADSTATUSOK: Indicates that the operation that caused the
event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT: Requests that further events
362 Chapter 6. Events
RecordsetChangeComplete Event
Description: Generated after the ADO recordset object has changed.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - adReason S9(9) COMP-5
3. VT_DISPATCH - pError OBJECT REFERENCE POW-COBJECT
4. VT_I4 - adStatus S9(9) COMP-5
5. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. adReason: Indicates the reason for this event as follows:
POW-ADODB-ADRSNREQUERY: An operation required the ADO recordset
object.
POW-ADODB-ADRSNRESYNCH: An operation resynchronized the ADO
recordset object with the database.
POW-ADODB-ADRSNCLOSE: An operation closed the ADO recordset
object.
3. pError: Indicates an ADO error object. It describes the error that occurred
if the value of adStatus parameter is
POW-ADODB-ADSTATUSERRORSOCCURRED;
otherwise it is not set.
4. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSERRORSOCCURRED: Indicates that the operation
that caused the event failed due to an error or errors.
POW-ADODB-ADSTATUSOK: Indicates that the operation that caused the
event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT: Requests that further events
of the type that caused this event to be generated should not be
generated.
5. pRecordset: Indicates a pointer to the recordset object, for which this
event is generated.
Details: Consult the ADO documentation for details.
Chapter 6. Events 363
Resized Event
Description: Generated when the form is resized.
Used in controls: None.
Used in objects: Form
Parameters: 1. VT_I2 - SizeState S9(4) COMP-5
2. VT_I4 - ClientWidth S9(9) COMP-5
3. VT_I4 - ClientHeight S9(9) COMP-5
Description of parameters: 1. SizeState: Contains the target state of the resize. Use the following
constants to determine the state:
POW-SIZE-RESTORED: Window is neither maximized, nor minimized -
its size is determined by the user or the application.
POW-SIZE-MINIMIZED: Window is minimized.
POW-SIZE-MAXIMIZED: Window is maximized.
2. ClientWidth: The new width of the form. The ScaleMode property
defines the units.
3. ClientHeight: The new height of the form. The ScaleMode property
defines the units.
Return Event
Description: Generated when the Return key is pressed or an equivalent condition,
specified for some control, occurs.
ComboBox 1. The text is being edited and the focus moves to another control in the
same form.
2. The text is being edited and the ENTER key is pressed.
The event is generated when the Style property is
"0 - Simple" or "1 - DropDown".
You can select which conditions cause the event to be generated in the
ComboBox property page.
Edit Generated in the following cases:
- If the ReturnWhenLostFocus property is True and the control has
the focus, the event is generated when the focus moves to another
control in the same form, before generating the LostFocus event.
- If ReturnWhenEnterKey property is True and you are editing a
string, the event is generated when the ENTER key is pressed.
- If ReturnWhenMaxText property is True, the event is generated
when the length of the text reaches the MaxLength property value.
Note that, the event is only generated when the text length is
changed. For example:
When the MaxLength property is 3, string "ABC" has already been
set into the Text property, and you select text "BC". If you replace
the text "BC" with "EF" using the Ctrl+V key, the text length is not
changed, so the event is not generated.
364 Chapter 6. Events
Table 1. A cell is being edited and the focus moves to another control in the
same form.
2. A cell is being edited and the focus moves to another cell using one of
the arrow keys.
3. A cell is being edited and the ENTER key is pressed.
4. The DecisionMaxString property is True and the input character string
reaches the effective maximum length (defined by the picture or date
string of RenderText property).
You can select which conditions cause the event to be generated in the
Table property page.
TextBox When the EditableLabel property is False:
1. The text is being edited and the focus moves to another control in the
same form.
2. The text is being edited and the ENTER key is pressed.
3. The input character string reaches the effective maximum length.
When EditableLabel property is True:
4. Data entry is concluded. See the TextBox control description.
The event is generated before the LostFocus event.
You can select which conditions cause the event to be generated in the
TextBox property page.
Note that if you do not set the RenderStyle property to "0 - Standard", the
maximum length depends on the picture or date style (it does not depend on
the setting of the MaxLength property).
Others 1. The text is being edited and the focus moves to another control in the
same form.
2. The text is being edited and the ENTER key is pressed.
Used in controls: ComboBox Table TextBox TreeView
ListView
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Chapter 6. Events 365
SelChange Event
Description: Generated when a selection changes as follows.
ComboBox and When the item selected in the list box changes.
ListBox The event is generated after the Click and DblClick events.
DriveList When the selected drive name in the list box changes.
FileList When the selected file name in the list box changes.
The event is generated after the Click and DblClick events.
FolderList When the selected folder name in the list box changes.
The event is generated after the Click and DblClick events.
Used in controls: ComboBox FileList FolderList ListBox
DriveList
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Select Event
Description: Generated when a menu item is selected.
Used in controls: None.
Used in objects: MenuItem
Parameters: None.
SelectClose Event
Description: Generated when a menu is closed.
Used in controls: None.
Used in objects: MenuItem
Parameters: None.
StartAnimation Event
Description: Generated when the first frame of the animation is replayed.
Note that if the AutoPlay property is True, the animation is started
automatically after the form is opened and this event is not generated. If
you stop animation and restart animation, the event is generated.
Used in controls: Animation
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
366 Chapter 6. Events
Stepped Event
Description: Generated when the increase in the Value property exceeds the value of the
Step property. The event is generated after the Change event.
Used in controls: ProgressIndicator
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
Timer Event
Description: Generated at the intervals specified in the Interval property when the Active
property is set to True.
Used in controls: Timer
Used in objects: None.
Parameters: [VT_I4 - Index S9(9) COMP-5]
Description of parameters: Index: When the control is part of an array, Index contains the control's
index in the array.
WillChangeField Event
Description: Generated before a pending operation changes the value of one or more
ADO field objects in the ADO recordset object.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - Reserved1 S9(9) COMP-5
3. VT_I4 - Reserved2 S9(9) COMP-5
4. VT_I4 - adStatus S9(9) COMP-5
5. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. Reserved1: Do not use this parameter. It is reserved for future use.
3. Reserved2: Do not use this parameter. It is reserved for future use.
4. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSCANCEL: Requests cancellation of the operation
that caused the event to occur.
POW-ADODB-ADSTATUSCANTDENY: Indicates that the operation cannot
request cancellation of the pending operation.
POW-ADODB-ADSTATUSOK: Indicates that the operation that caused
the event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT: Requests that further
events of the type that caused this event to be generated should
not be generated.
5. pRecordset: Indicates a pointer to the recordset object, for which this
event generated.
Details: Consult the ADO documentation for details.
Chapter 6. Events 367
WillChangeRecord Event
Description: Generated before one or more records (rows) in the ADO recordset object
change.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - adReason S9(9) COMP-5
3. VT_I4 - adStatus S9(9) COMP-5
4. VT_I4 - cRecords S9(9) COMP-5
5. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. adReason: Indicates the reason for this event as follows:
POW-ADODB-ADRSNADDNEW: An operation will add a new record.
POW-ADODB-ADRSNDELETE: An operation will delete a record.
POW-ADODB-ADRSNUPDATE: An operation will update an existing
record.
POW-ADODB-ADRSNUNDOUPDATE: An operation will reverse the
update of a record.
POW-ADODB-ADRSNUNDOADDNEW: An operation will reverse the
addition of a new record.
POW-ADODB-ADRSNUNDODELETE: An operation will reverse the
deletion of a record.
POW-ADODB-ADRSNFIRSTCHANGE: An operation will make the first
change to a record.
3. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSCANCEL: Requests cancellation of the operation
that caused the event to occur.
POW-ADODB-ADSTATUSCANTDENY: Indicates that the operation cannot
request cancellation of the pending operation.
POW-ADODB-ADSTATUSOK: Indicates that the operation that caused
the event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT: Requests that further
events of the type that caused this event to be generated should
not be generated.
4. cRecords: Indicates the number of records changing.
5. pRecordset: Indicates a pointer to the recordset object, for which this
event is generated.
Details: Consult the ADO documentation for details.
368 Chapter 6. Events
WillChangeRecordset Event
Description: Generated before pending operation changes the ADO recordset object.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - adReason S9(9) COMP-5
3. VT_I4 - adStatus S9(9) COMP-5
4. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. adReason: Indicates the reason for this event as follows:
POW-ADODB-ADRSNREQUERY: An operation will require the ADO
recordset object.
POW-ADODB-ADRSNRESYNCH: An operation will resynchronize the ADO
recordset object with the database.
POW-ADODB-ADRSNCLOSE: An operation will close the ADO recordset
object.
3. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSCANCEL: Requests cancellation of the operation
that caused the event to occur.
POW-ADODB-ADSTATUSCANTDENY: Indicates that the operation cannot
request cancellation of the pending operation.
POW-ADODB-ADSTATUSOK: Indicates that the operation that caused
the event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT: Requests that further
events of the type that caused this event to be generated should
not be generated.
4. pRecordset: Indicates a pointer to the recordset object, for which this
event is generated.
Details: Consult the ADO documentation for details.
Chapter 6. Events 369
WillMove Event
Description: Generated before a pending operation changes the current position in the
ADO recordset object.
Used in controls: ADODataSource
Used in Objects: None.
Parameters: 1. [VT_I4 - Index S9(9) COMP-5]
2. VT_I4 - adReason S9(9) COMP-5
3. VT_I4 - adStatus S9(9) COMP-5
4. VT_DISPATCH - pRecordset OBJECT REFERENCE POW-COBJECT
Description of parameters: 1. Index: When the control is part of an array, Index contains the control's
index in the array.
2. adReason: Indicates the reason for this event as follows:
POW-ADODB-ADRSNMOVEFIRST: An operation will move the record
pointer to the first record in the ADO recordset object.
POW-ADODB-ADRSNMOVELAST: An operation will move the record
pointer to the last record in the ADO recordset object.
POW-ADODB-ADRSNMOVENEXT: An operation will move the record
pointer to the next record in the ADO recordset object.
POW-ADODB-ADRSNMOVEPREVIOUS: An operation will move the record
pointer to the previous record in the ADO recordset object.
POW-ADODB-ADRSNMOVE: An operation will move the record pointer
within the ADO recordset object.
POW-ADODB-ADRSNREQUERY: An operation will require the ADO
recordset object.
3. adStatus: Indicates or requests the current status as follows:
POW-ADODB-ADSTATUSCANCEL: Requests cancellation of the operation
that caused the event to occur.
POW-ADODB-ADSTATUSCANTDENY: Indicates that the operation cannot
request cancellation of the pending operation.
POW-ADODB-ADSTATUSOK: Indicates that the operation that caused
the event was successful.
POW-ADODB-ADSTATUSUNWANTEDEVENT: Requests that further
events of the type that caused this event to be generated should
not be generated.
4. pRecordset: Indicates a pointer to the recordset object, for which this
event is generated.
Details: Consult the ADO documentation for details.
370 Chapter 6. Events
Appendix A. Color Constants
For properties having the OLE data type "OLE_COLOR" PowerCOBOL provides
COBOL constants that you can use to set the colors. There are two sets of color
constants:
• Constants for the 16 standard colors
• Constants for the system colors
• These are listed in the tables below.
Black POW-COLOR-BLACK
Blue POW-COLOR-BLUE
Cyan POW-COLOR-CYAN
Gray POW-COLOR-GRAY
Green POW-COLOR-GREEN
Magenta POW-COLOR-MAGENTA
Red POW-COLOR-RED
White POW-COLOR-WHITE
Yellow POW-COLOR-YELLOW
Dark blue POW-COLOR-DARKBLUE
Dark cyan POW-COLOR-DARKCYAN
Dark gray POW-COLOR-DARKGRAY
Dark green POW-COLOR-DARKGREEN
Dark magenta POW-COLOR-DARKMAGENTA
Dark red POW-COLOR-DARKRED
Dark yellow POW-COLOR-DARKYELLOW
Active title bar POW-COLOR-ACTIVETITLEBAR
Active title bar text POW-COLOR-ACTIVETITLEBARTEXT
Active window border POW-COLOR-ACTIVEBORDER
Application workspace POW-COLOR-APPLICATIONWORKSPACE
Button dark shadow POW-COLOR-BUTTONDARKSHADOW
Button highlight POW-COLOR-BUTTONHIGHLIGHT
Button light shadow POW-COLOR-BUTTONLIGHTSHADOW
Button shadow POW-COLOR-BUTTONSHADOW
Button surface POW-COLOR-BUTTONFACE
Button text POW-COLOR-BUTTONTEXT
Desktop POW-COLOR-DESKTOP
Disabled text POW-COLOR-DISABLEDTEXT
Highlight POW-COLOR-HIGHLIGHT
Highlighted text POW-COLOR-HIGHLIGHTEDTEXT
Inactive title bar POW-COLOR-INACTIVETITLEBAR
372 Appendix A. Color Constants
372
Appendix B. Key Code Constants
You can use the following constants to check the contents of the KeyCode argument
of the KeyDown, KeyPress and KeyUp events.
Key Constant
[0] to [9] POW-KEY-0 to POW-KEY-9
[A] to [Z] POW-KEY-A to POW-KEY-Z
[Alphanumerical Japanese POW-KEY-KANA
syllabary – for 2 byte
character code systems]
[Alt] POW-KEY-MENU
[Application Key] POW-KEY-APPS
[Back Space] POW-KEY-BACK
[Break] POW-KEY-CANCEL
[Caps Lock] POW-KEY-CAPITAL
[Clear] POW-KEY-CLEAR
[Ctrl] POW-KEY-CONTROL
[Del] POW-KEY-DELETE
[Down arrow] POW-KEY-DOWN
[End] POW-KEY-END
[Enter] POW-KEY-RETURN
[Esc] POW-KEY-ESCAPE
[F1] to [F24] POW-KEY-F1 to POW-KEY-F24
[Home] POW-KEY-HOME
[Ins] POW-KEY-INSERT
[Left arrow] POW-KEY-LEFT
[Left Windows Key] POW-KEY-LWIN
[Num Lock] POW-KEY-NUMLOCK
[Numeric pad * ] POW-KEY-MULTIPLY
[Numeric pad . ] POW-KEY-DECIMAL
[Numeric pad / ] POW-KEY-DIVIDE
[Numeric pad - ] POW-KEY-SUBTRACT
[Numeric pad + ] POW-KEY-ADD
[Numeric Pad 0] to POW-KEY-NUMPAD0 to
[Numeric Pad 9] POW-KEY-NUMPAD9
[Page Down] POW-KEY-NEXT
[Page Up] POW-KEY-PRIOR
[Pause] POW-KEY-PAUSE
[Print Screen] POW-KEY-SNAPSHOT
[Right arrow] POW-KEY-RIGHT
[Right Windows Key] POW-KEY-RWIN
[Scroll Lock] POW-KEY-SCROLL
374 Appendix B. Key Code Constants
Key Constant
[Shift] POW-KEY-SHIFT
[Space] POW-KEY-SPACE
[Tab] POW-KEY-TAB
[Up arrow] POW-KEY-UP
374
Appendix C. Data Types
Because PowerCOBOL V6.1 is designed to comply with the Component Object Model
(COM) most properties and parameters are defined in terms of an OLE (Object
Linking and Embedding) data type. Within this help system COBOL equivalents are
always given first. The descriptions below provide fuller details of each of the OLE
data types.
Note: The COBOL equivalents indicate only the standard definitions that correspond
to the OLE VT data types. In some cases you may want to use more digits than
provided in the COBOL definition, in which case you should define more digits in the
PICTURE string. For example, OLE_COLOR has 4 bytes numeric with a COBOL
equivalent of S9(9) COMP-5; however, the system color may contain 10 digits. In
this case you would define the COBOL data as S9(10) COMP-5 – although this
allocates 8 bytes of memory the higher 4 bytes are always zero so the item still maps
to OLE_COLOR.
The following data types are used in objects provided by PowerCOBOL:
380
Appendix E. Property and Parameter Constants
PowerCOBOL provides you with a number of constants that you can use to set
properties or parameters, rather than using numeric literals or defining your own
constants.
These constants are listed below in alphabetical order of the property or parameter
to which they apply. Table E.1 provides a list of all the properties and parameters for
which constants are provided and listed in this appendix.
The constants are then listed, in the order of the properties and parameters listed in
Table E.1.
Table E.1. List or Properties and Parameters that have PowerCOBOL Constants
AccessMode Property MenuBreak Property
adReason Parameter (ADODataSource) MouseButton Parameter
adStatus Parameter (ADODataSource) MousePointer Property
Align Property MultiSelect Property (FileList/ListBox)
Alignment Property (CheckBox, OptionButton) OptionButtonClickMode
Alignment Property (Frame) Orientation Property (Others)
Alignment Property (Frame, StaticText, TableColumn) Orientation Property (Tab)
Alignment Property (TextBox, Column) PageNoFormat Property
Appearance Property PaperOrientation Property
Arrange Property PaperScaleUnit Property
BackStyle Property (Shape) PaperType Property
BackStyle Property (Shape, TextBox, Others) PcdColorType Property
BorderStyle Property (Form) PcdResolution Property
BorderStyle Property (Frame/Shape/Others) RenderStyle Property
BorderStyle Property (Shape) ScaleMode Property
ColorMap Property ScaleModeIn/ScaleModeOut Parameters
CommandButtonFunctionKeyMode ScaleMode Parameters
CommandType Property ScalingStyle Property
CommitMode Property ShapeStyle Property
ConcurrencyCursor Property ShiftState Parameter
ConnectMode Property SortKind Property
CursorLocation Property SortOrder Property
CursorType Property (ADODataSource) Source Property
CursorType Property (DBAccess) StartUpPosition Property
DateStyle Property Style Property (Button)
DDEDataStyle Property Style Property (ComboBox)
DDELinkStyle Property Style Property (Tab)
DisabledFocusAction Property Style Property (Toolbar)
DisabledImageType Property TabWidthStyle Property
EdgeStyle Property TargetType Property
FileType Property TextCase Property
382 Appendix E. Property and Parameter Constants
AccessMode Property
Value Constant
0 - Read-Write POW-DB-READWRITE
1 - ReadOnly POW-DB-READONLY
adReason Parameter
(Events of the ADODataSource Control)
Value Constant
An operation added a new record. POW-ADODB-ADRSNADDNEW
An operation deleted a record. POW-ADODB-ADRSNDELETE
An operation closed the ADO recordset object. POW-ADODB-ADRSNCLOSE
An operation made the first change to a record. POW-ADODB-ADRSNFIRSTCHANGE
An operation moved the record pointer within the POW-ADODB-ADRSNMOVE
ADO recordset object.
An operation moved the record pointer to the first POW-ADODB-ADRSNMOVEFIRST
record in the ADO recordset object.
An operation moved the record pointer to the last POW-ADODB-ADRSNMOVELAST
record in the ADO recordset object.
An operation moved the record pointer to the next POW-ADODB-ADRSNMOVENEXT
record in the ADO recordset object.
An operation moved the record pointer to the POW-ADODB-ADRSNMOVEPREVIOUS
previous record in the ADO recordset object.
An operation required the ADO recordset object. POW-ADODB-ADRSNREQUERY
An operation resynchronized the ADO recordset POW-ADODB-ADRSNRESYNCH
object with the database.
An operation reversed the addition of a new record. POW-ADODB-ADRSNUNDOADDNEW
An operation reversed the deletion of a record. POW-ADODB-ADRSNUNDODELETE
An operation reversed the update of a record. POW-ADODB-ADRSNUNDOUPDATE
An operation updated an existing record. POW-ADODB-ADRSNUPDATE
Appendix E. Property and Parameter Constants 383
adStatus Parameter
(Events of the ADODataSource Control)
Value Constant
Requests cancellation of the operation that caused POW-ADODB-ADSTATUSCANCEL
the event to occur.
Indicates that the operation cannot request POW-ADODB-ADSTATUSCANTDENY
cancellation of the pending operation.
Indicates that the operation that caused the event POW-ADODB-ADSTATUSERRORSOCCURRED
failed due to an error or errors.
Indicates that the operation that caused the event POW-ADODB-ADSTATUSOK
was successful.
Requests to prevent subsequent notifications before POW-ADODB-ADSTATUSUNWANTEDEVENT
the event method has finished executing.
Align Property
Value Constant
0 - None POW-ALIGNNONE
1 - Top POW-ALIGNTOP
2 - Bottom POW-ALIGNBOTTOM
3 - Left POW-ALIGNLEFT
4 - Right POW-ALIGNRIGHT
Appearance Property
Value Constant
0 - Flat POW-APPEARANCE-FLAT
1 - 3D POW-APPEARANCE-3D
Arrange Property
Value Constant
0 - None POW-LVICON-AUTO
1 - Left POW-LVICON-LEFT
2 - Top POW-LVICON-TOP
ColorMap Property
Value Constant
0 - No POW-COLORMAP-NO
1 - Back POW-COLORMAP-BACK
2 - All POW-COLORMAP-ALL
CommandButtonFunctionKeyMode
Value Constant
0 - Normal POW-FUNCTIONKEYMODE-NORMAL
1 - Set focus to CommandButton control POW-FUNCTIONKEYMODE-FOCUS
386 Appendix E. Property and Parameter Constants
CommandType Property
Value Constant
1 - adCmdText POW-ADODB-ADCMDTEXT
2 - adCmdTable POW-ADODB-ADCMDTABLE
4 - adCmdStoredProc POW-ADODB-ADCMDSTOREDPROC
8 - adCmdUnknown POW-ADODB-ADCMDUNKNOWN
CommitMode Property
Value Constant
0 - Automatic POW-DBCOMMIT-AUTO
1 - Manual POW-DBCOMMIT-MANUAL
ConcurrencyCursor Property
Value Constant
1 - SQL_CONCUR_READ_ONLY POW-DBCONCUR-READONLY
2 - SQL_CONCUR_LOCK POW-DBCONCUR-LOCK
3 - SQL_CONCUR_OPT_ROWVER POW-DBCONCUR-OPTROWVER
4 - SQL_CONCUR_OPT_VALUES POW-DBCONCUR-OPTVALUES
ConnectMode Property
Value Constant
0 - adModeUnknown POW-ADODB-ADMODEUNKNOWN
1 - adModeRead POW-ADODB-ADMODEREAD
2 - adModeWrite POW-ADODB-ADMODEWRITE
3 - adModeReadWrite POW-ADODB-ADMODEREADWRITE
4 - adModeShareDenyRead POW-ADODB-ADMODESHAREDENYREAD
8 - adModeShareDenyWrite POW-ADODB-ADMODESHAREDENYWRITE
12 - adModeShareExclusive POW-ADODB-ADMODESHAREEXCLUSIVE
16 - adModeShareDenyNone POW-ADODB-ADMODESHAREDENYNONE
CursorLocation Property
Value Constant
2 - adUserServer POW-ADODB-ADUSERSERVER
3 - adUserClient POW-ADODB-ADUSERCLIENT
Appendix E. Property and Parameter Constants 387
DateStyle Property
Value Constant
0 - Month dd yyyy POW-DATESTYLE-MONTHDDYYYY
1 - yyyy/ MM /dd POW-DATESTYLE-YYYYMMDD-SLASH
2 - yyyy. MM.dd POW-DATESTYLE-YYYYMMDD-PERIOD
3 - MM /dd/yyyy POW-DATESTYLE-MMDDYYYY-SLASH
4 - MM.dd.yyyy POW-DATESTYLE-MMDDYYYY-PERIOD
5 - Mon dd yyyy POW-DATESTYLE-MONDDYYYY
99 - Custom POW-DATESTYLE-CUSTOM
DDEDataStyle Property
Value Constant
10 - Text POW-DDETEXT
11 - Binary POW-DDEBINARY
DDELinkStyle Property
Value Constant
1 - Hot Link POW-DDEHOTLINK
2 - Worm Link POW-DDEWARMLINK
DisabledFocusAction Property
Value Constant
0 - Normal POW-DFA-NORMAL
1 - Ignore option button value POW-DFA-IGNOREOPTIONVALUE
388 Appendix E. Property and Parameter Constants
DisabledImageType Property
Value Constant
0 - None POW-DISABLEDIMAGE-NONE
1 - Simple POW-DISABLEDIMAGE-SIMPLE
2 - 3D POW-DISABLEDIMAGE-3D
EdgeStyle Property
Value Constant
0 - Bump POW-EDGEBUMP
1 - Etched POW-EDGEETCHED
2 - Raised POW-EDGERAISED
3 - Sunken POW-EDGESUNKEN
4 - Raised Light POW-EDGERAISEDLIGHT
5 - Sunken Light POW-EDGESUNKENLIGHT
FileType Property
Value Constant
0 - Standard Text File POW-FILETYPE-NORECORD
1 - CSV Format POW-FILETYPE-CSV
2 - Fixed Length Format POW-FILETYPE-FIXEDLENGTH
FillStyle Property
Value Constant
0 - None POW-FILLSTYLE-NONE
1 - Solid POW-FILLSTYLE-SOLID
2 - Horizontal POW-FILLSTYLE-HORIZONTAL
3 - Vertical POW-FILLSTYLE-VERTICAL
4 - Backward diagonal POW-FILLSTYLE-BDIAGONAL
5 - Forward diagonal POW-FILLSTYLE-FDIAGONAL
6 - Cross POW-FILLSTYLE-CROSS
7 - Diagonal cross POW-FILLSTYLE-DIAGONAL
FrameStyle Property
Value Constant
0 - GroupBox POW-FRAME-GROUPBOX
1 - Panel POW-FRAME-PANEL
Appendix E. Property and Parameter Constants 389
GraphStyle Property
Value Constant
0 - Vertical Bar POW-GRAPHSTYLE-VERTICALBAR
1 - Horizontal Bar POW-GRAPHSTYLE-HORIZONTALBAR
2 - Line POW-GRAPHSTYLE-LINE
3 - Pie POW-GRAPHSTYLE-PIE
Icon Property
Value Constant
0 - Default POW-ICON-DEFAULT
1 - Application POW-ICON-APPLICATION
2 - Hand POW-ICON-HAND
3 - Question POW-ICON-QUESTION
4 - Exclamation POW-ICON-EXCLAMATION
5 - Asterisk POW-ICON-ASTERISK
6 - Winlogo POW-ICON-WINLOGO
99 - Custom POW-ICON-CUSTOM
ImageMode Property
Value Constant
0 - Standard POW-IMAGEMODE-STANDARD
1 - Stretch POW-IMAGEMODE-STRETCH
2 - Auto POW-IMAGEMODE-AUTO
3 - Adjust POW-IMAGEMODE-ADJUST
IMEMode Property
Value Constant
0 - None POW-IMENOOPERATION
1 - On POW-IMEON
2 - Off POW-IMEOFF
3 - Disable POW-IMEDISABLE
4 - Hiragana Full POW-IMEDBCSHIRAGANA
5 - Katakana Full POW-IMEDBCSKATAKANA
6 - Katakana Half POW-IMESBCSKATAKANA
7 - Alphabet Full POW-IMEDBCSALPHABET
8 - Alphabet Half POW-IMESBCSALPHABET
390 Appendix E. Property and Parameter Constants
Layout Property
Value Constant
0 - Horizontal POW-LAYOUT-HORIZONTAL
1 - Vertical POW-LAYOUT-VERTICAL
LockType Property
Value Constant
-1 - adLockUnspecified POW-ADODB-ADLOCKSPECIFIED
1 - adLockReadOnly POW-ADODB-ADLOCKREADONLY
2 - adLockPessimistic POW-ADODB-ADLOCKPESSIMISTIC
3 - adLockOptimistic POW-ADODB-ADLOCKOPTIMISTIC
4 - adLockBatchOptimistic POW-ADODB-ADLOCKBATCHOPTIMISTIC
LVStyle Property
Value Constant
0 - Large Icon POW-LVSTYLE-LARGEICON
1 - Small Icon POW-LVSTYLE-SMALLICON
2 - List POW-LVSTYLE-LIST
3 - Report POW-LVSTYLE-REPORT
MenuBreak Property
Value Constant
0 - Not MenuBreak POW-NOBREAK
1 - MenuBreak POW-BREAK
2 - MenuBarBreak POW-BARBREAK
MousePointer Property
Value Constant
0 - Default POW-MP-DEFAULT
1 - Arrow POW-MP-ARROW
2 - Cross POW-MP-CROSS
3 - Ibeam POW-MP-IBEAM
4 - Icon POW-MP-ICON
5 - Size POW-MP-SIZE
6 - SizeNESW POW-MP-SIZENESW
7 - SizeNS POW-MP-SIZENS
8 - SizeNWSE POW-MP-SIZENWSE
9 - SizeWE POW-MP-SIZEWE
10 - UpArrow POW-MP-UPARROW
11 - Wait POW-MP-WAIT
12 - AppStarting POW-MP-APPSTARTING
13 - No POW-MP-NO
14 - SizeAll POW-MP-SIZEALL
15 - Help POW-MP-HELP
99 - Custom POW-MP-CUSTOM
OptionButtonClickMode Property
Value Constant
0 - Normal POW-CLICKMODE-NORMAL
1 - When left button is pressed POW-CLICKMODE-LBUTTONDOWN
PageNoFormat Property
Value Constant
0 - None POW-NOPAGENO
1 - Page POW-CURRENTPAGE
2 - Page/Total POW-CURRENTTOT
PaperOrientation Property
Value Constant
0 - Auto POW-DEFAULTORIENTATION
1 - Portrait POW-PORTRAIT
2 - Landscape POW-LANDSCAPE
PaperScaleUnit Property
Value Constant
0 - mm POW-MM
1 - Inch POW-INCH
PaperType Property
Value Constant
0 - Auto POW-DEFAULTSIZE
1 - Letter 216x279 mm/Letter 8.5x11 inch POW-PAPERLETTER
5 - Legal 216x356 mm/Legal 8.5x14 inch POW-PAPERLEGAL
8 - A3 297x420 mm/A3 11.5x16.5 inch POW-PAPERA3
9 - A4 210x297 mm/A4 8.2x11.5 inch POW-PAPERA4
11 - A5 148x210 mm/5.8x8.2 inch POW-PAPERA5
12 - B4 257x364 mm/10x14.3 inch POW-PAPERB4
13 - B5 182x257 mm/7x10 inch POW-PAPERB5
Appendix E. Property and Parameter Constants 393
PcdColorType Property
Value Constant
0 - 24bit color POW-PCDCOLORTYPE-24BITCOLOR
1 - 256 color POW-PCDCOLORTYPE-256COLOR
2 - 16 color POW-PCDCOLORTYPE-16COLOR
3 - 256 gray scale color POW-PCDCOLORTYPE-256GRAY
PcdResolution Property
Value Constant
0 - BASE_OVER_64 (64 x 96) POW-PCDRESOLUTION-BASE-OVER-64
1 - BASE_OVER_16 (128 x 192) POW-PCDRESOLUTION-BASE-OVER-16
2 - BASE_OVER_4 (256 x 384) POW-PCDRESOLUTION-BASE-OVER-4
3 - BASE (512 x 768) POW-PCDRESOLUTION-BASE
4 - 4BASE (1024 x 1526) POW-PCDRESOLUTION-4BASE
5 - 16BASE (2048 x 3072) POW-PCDRESOLUTION-16BASE
RenderStyle Property
Value Constant
0 - Standard POW-RENDERSTYLE-STANDARD
1 - COBOL PICTURE POW-RENDERSTYLE-COBOLPICTURE
2 - Date POW-RENDERSTYLE-DATE
ScaleMode Property
ScaleModeIn/ScaleModeOut Parameters (ConvertScale
method),
ScaleMode Parameters (GetScreenSize/GetWorkArea
methods)
Value Constant
0 - Pixels POW-SCALEPIXELS
1 - 1/100mm POW-SCALEHIMETRIC
2 - 1/1000inch POW-SCALEHIENGLISH
3 - 1/20Points POW-SCALETWIPS
394 Appendix E. Property and Parameter Constants
ScalingStyle Property
Value Constant
0 - None POW-SCALING-NONE
1 - Resize only POW-SCALING-SIZE
2 - Reposition only POW-SCALING-POSITION
3 - Resize and reposition POW-SCALING-SIZEPOSITION
5 - Resize with resize font POW-SCALING-SIZEFONT
7 - Resize and reposition with resize font POW-SCALING-SIZEPOSITIONFONT
ShapeStyle Property
Value Constant
0 - Rectangle POW-SHAPESTYLE-RECTANGLE
1 - Square POW-SHAPESTYLE-SQUARE
2 - Circle POW-SHAPESTYLE-CIRCLE
3 - Ellipse POW-SHAPESTYLE-ELLIPSE
SortKind Property
Value Constant
0 - Text POW-SORTKIND-TEXT
1 - Numeric POW-SORTKIND-NUMERIC
SortOrder Property
Value Constant
0 - None POW-SORTORDER-NONE
1 - Ascending POW-SORTORDER-ASC
2 - Descending POW-SORTORDER-DESC
Appendix E. Property and Parameter Constants 395
Source Property
Value Constant
0 - Default POW-PRINTSOURCE-DEFAULT
StartUpPosition Property
Value Constant
0 - Auto POW-STARTUPPOS-AUTO
1 - Center Owner POW-STARTUPPOS-CENTEROWN
2 - Center Screen POW-STARTUPPOS-CENTERSCR
3 - Windows Default POW-STARTUPPOS-DEFAULT
4 - Manual POW-STARTUPPOS-MANUAL
TabWidthStyle Property
Value Constant
0 - Normal POW-TAB-STYLE-NORMAL
1 - Fixed POW-TAB-STYLE-FIXED
TargetType Property
Value Constant
0 - Table/View POW-TARGETYPE-TABLE
1 - Procedure POW-TARGETYPE-PROCEDURE
TextCase Property
Value Constant
0 - Normal POW-TEXTCASE-NORMAL
1 - UpperCase POW-TEXTCASE-UPPERCASE
2 - LowerCase POW-TEXTCASE-LOWERCASE
TickStyle Property
Value Constant
0 - No Ticks POW-TICKSTYLE-NOTICKS
1 - Bottom/Right POW-TICKSTYLE-BOTTOMRIGHT
2 - Top/Left POW-TICKSTYLE-TOPLEFT
3 - Both POW-TICKSTYLE-BOTH
TimeFormat Property
Value Constant
0 - Millisecond POW-MCIFORMATMILLISECONDS
2 - Minute/second/frame POW-MCIFORMATMSF
3 - Frame POW-MCIFORMATFRAMES
10 - Track/minute/second/frame POW-MCIFORMATTMSF
TVLineStyle Property
Value Constant
0 - TreeLines POW-TVLINESTYLE-TREELINES
1 - RootLines POW-TVLINESTYLE-ROOTLINES
Appendix E. Property and Parameter Constants 397
TVStyle Property
Value Constant
0 - Text Only POW-TVSTYLE-TEXTONLY
1 - Image and Text POW-TVSTYLE-IMAGE
2 - Plus/Minus and Text POW-TVSTYLE-PLUSMINUS
3 - Plus/Minus, Image and Text POW-TVSTYLE-PLUSMINUSIMAGE
4 - TreeLines and Text POW-TVSTYLE-LINE
5 - TreeLines, Image and Text POW-TVSTYLE-LINEIMAGE
6 - TreeLines, Plus/Minus and Text POW-TVSTYLE-LINEPLUSMINUS
7 - TreeLines, Plus/Minus, Image and Text POW-TVSTYLE-LINEPLUSMINUSIMAGE
Weight Property
Value Constant
Normal POW-FONTWEIGHT-NORMAL
Bold POW-FONTWEIGHT-BOLD
WindowAdjustment Property
Value Constant
0 - Standard POW-MCIWINADJUST-STANDARD
1 - Adjust Control Window POW-MCIWINADJUST-CONTROLWINDOW
2 - Adjust Device Frame POW-MCIWINADJUST-DEVICEFRAME
WindowState Property
Value Constant
0 - Normal POW-WINDOWSTATE-NORMAL
1 - Maximize POW-WINDOWSTATE-MAXIMIZE
2 - Minimize POW-WINDOWSTATE-MINIMIZE
398 Appendix E. Property and Parameter Constants
Zorder Method
Value Constant
0 - Puts the control at the top of the order. POW-ZORDER-FRONT
1 - Puts the control at the bottom of the order. POW-ZORDER-BACK
Appendix F. Shortcut Keys
This appendix lists the shortcut keys available in the following areas of the
development environment:
• Project Window
- Common Operations
- Object Tree
- Property List
- Build View
- Debug View
• Form Edit Window
• Tab Order Setting Window
• PowerCOBOL Editor Window
Key Description
Delete Delete the selected string, or the character to the right of the cursor.
Backspace Delete the selected string or the character to the left of the cursor.
Shift + Tab Switches focus between windowpanes when the edit window is split.
Home Move the cursor to the beginning of the line.
Ctrl + Home Move the cursor to the first line of the code.
Shift + Home Expand the selected area to the beginning of the line.
Ctrl + Shift + Home Expand the selected area to the first line of the code
End Move the cursor to the end of the line
Ctrl + End Move the cursor to the last line of the code.
Shift + End Expand the selected area to the end of the line.
Ctrl + Shift + End Expand the selected area to the last line of the code.
Move the cursor left one character.
Ctrl + Move the cursor to the beginning of the previous word.
Shift + Expand the selected area by 1 character to the left.
Ctrl + Shift + Expand the selected area to the beginning of the previous word.
Move the cursor one character to the right.
Ctrl + Move the cursor to the beginning of the next word.
Shift + Expand the selected area one character to the right.
Ctrl + Shift + Expand the selected area to the beginning of the next word.
Move the cursor to the previous line.
Shift + Expand the selected area to the previous line.
Move the cursor to the next line.
Shift + Expand the selected area to the next line.
PageUp Move the cursor to the previous page.
Shift + PageUp Expand the selected area to the previous page.
PageDown Move the cursor to the next page.
Shift + PageDown Expand the selected area to the next page.
404 Appendix F. Shortcut Keys
Index
AccessMode Property, 89 BorderColor Property, 103
Activate Method, 265 BorderRound Property, 104
Active Property, 89 BorderStyle Property, 105
ActiveControl Property, 90 BorderWidth Property, 106
Add Method, 265 BottomMargin Property, 106
AddString Method, 266 Button object, 33
AddTick Method, 267 ButtonClick Event, 339
ADODataSource control, 44 Buttons Property, 107
AdviseDDE Method, 267 CallForm Method, 269
Alarm Method, 268 CallForm2 Method, 271
Align Property, 91 Cancel Property, 107
Alignment Property, 92 Caption Property, 108
Animation control, 45 CaptionBackGray Property, 109
Appearance Property, 94 CellLines Property, 109
Archive Property, 95 Change Event, 339
Arrange Property, 95 ChangeDDEItem Method, 272
Array property, 96 Charset Property, 110
AutoChange Property, 96 Check Property, 110
AutoEdit Property, 97 CheckBox control, 46
AutoHScroll Property, 97 Child Property (Array), 111
AutoLoadFile Property, 98 CHVisible Property, 111
AutoOpen Property, 98 ClassMajorVersion Property, 112
AutoPlay Property, 99 ClassMinorVersion Property, 112
AutoRowHeight Property, 99 ClassProgID Property, 112
AutoSize Property, 100 Clear Method, 273
AutoTick Property, 100 ClearList Method, 273
BackColor Property, 101 ClearSelect Method, 274
BackStyle Property, 102 ClearTable Method, 274
BeforeClick Event, 338 ClearTicks Method, 274
BlankSuppress Property, 102 Click Event, 340
Bold Property, 103 ClickColumn Property, 113
BookName Property, 103 ClickRow Property, 113
Boolean constants, 379 ClientHeight Property, 113