Structures
\The Sandbox \PB History & Future \New in PB 2 \Painter Features \Structures
Application
Painter
Database Painter
DataWindow
Painter
Debug
Drag & Drop
Support
Function Painter
Library
Painter
MDI Windows
Menu
Painter
PowerScript
Painter
Preferences
Structures
User Object
Painter
Window
Painter

A structure is a collection of one or more related variables of the same or different data types grouped under one name.  Structures allow you to refer to related objects as a unit rather than individually.  For example, if you define the user's ID, Address, Access Level, and a picture (bitmap) of the employee as a structure called user_struct, you can then refer to this collection of variables a user_struct. 

TIP:   In some languages, for example Pascal and COBOL, structures are called records.

Graphic example

In graphic applications structures are frequently used for objects.  The standard PowerBuilder and Windows objects are structures.  User-defined structures can be used to define frequently used graphic components.  For example, a structure that contains the x and y coordinates of a point.

Creating a User Structure

To create a structure in PowerBuilder, use the Structure Painter.   In this painter, you enter the names and data types of the variables you want to use in the structure and then name the structure.

Using a Structure

After you define the structure, you can:

    Copy it

    Assign it values

    Pass it to functions

    Have functions return values to the structure

but you cannot compare structures.

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

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