Updating Control Arrays
\The Sandbox \PB History & Future \New In PB6 \Ease of Use & PowerScript \Updating Control Arrays
Nonmodal
Browser
Browser Menus
Browser Help
Last Compiled
Time Stamp
Modernized
Toolbar
Support for
IntelliMouse
App Object
Modification
Timing Object
Updating
Control Arrays
AncestorReturn-
Value
Class Definition
Information

Description

The control property arrays of windows and Tab controls are updated when you use PowerScript functions to add controls or tab pages.

Purpose

You can now use the built-in control property array to reference all the controls in a window or all the pages in a Tab control. Previously, the control property array only kept track of controls or tab pages added in the Window painter. If you wanted to perform an operation on all the controls in a window or all the pages in a Tab control, you had to create and manage your own array of references to each control or tab page.

Migration note

To avoid conflicts, code that uses a user-defined array to keep track of controls or tab pages should be changed to use the built-in control property.array.

Usage

The control property of a window is an array that keeps track of the controls on the window. The control property of a Tab control is an array that keeps track of the tab pages on the Tab control. You can refer to each control or tab page by its index in the control array.

When you call OpenUserObject or OpenTab, the control property array grows by one element. The new element is a reference to the newly opened object. For example, the following statement adds a new tab in the second position in the Tab control:

    tab_1.OpenTab(uo_newtab, 2)

The second element in the control array for tab_1 now refers to uo_newtab, and the index into the control array for all subsequent tab pages becomes one greater.

When you call CloseUserObject or CloseTab, the size of the array is reduced by one and the reference to the user object or page is destroyed. If the closed tab was not the last element in the array, the index for all subsequent tab pages is reduced by one.

The MoveTab function changes the order of the pages in a Tab control and also reorders the elements in the control array to match the new tab order.

Functions

The following functions are affected by this feature:

OpenTab( )

OpenUserObject( )

OpenTabWithParm()

OpenUserObjectWithParm( )

CloseTab( )

CloseUserObject( )

MoveTab( )

PBL Peeper PB Help PB History
& Future About Us Feedback Site Map

Google
 
Web www.techno-kitten.com
www.sybase.com