Introduction to PowerBuilder

HomePrevious Lesson: Variable Declarations
Next Lesson: Accessing Object's Attributes

Standard Data Types

There are two types of data in PowerBuilder: standard and enumerated. The following table lists the standard data types:

Datatypes

Range

Boolean

TRUE or FALSE.

Character (char)

A single ASCII character.

String

Any ASCII character. Length: 0 to 2,147,483,647.

Integer (int)

-32,768 to +32,767.

Long

-2,147,483,648 to + 2,147,483,647.

Real

Single floating point, six digits precision, range 1.17 E -38 to 3.4 E +38.

Decimal

Single decimal numbers with up to 18 digit.

Double

Single floating point, 15 digits precision, range: 2.2E-308 to 1.7E+308.

Date

Includes full year (1000 to 3000).

Time

Time in 24-hour format - supports fraction of a second (up to six digits).

DateTime

Date and Time together.

UnsignedInteger (Uint)

0 to 65,535.

UnsignedLong (Ulong)

0 to 4,294.967,295.

Blob

Binary large object (No limit).

Any

Can hold any kind of value, including standard data types, objects, structures, and arrays. A variable whose type is Any is a chameleon data type�it takes the data type of the value assigned to it.

Enumerated data types are used as arguments in functions, in the script to specify the object attributes, in passing arguments to functions, etc. To see the supported enumerated data types, invoke the browser by clicking icon and click on the Enumerated tab. On the left-hand side, you will see the attributes that need a value of enumerated datatype. Click on the attribute name and click the properties option on the right side, you will see the valid enumerated values for that attribute.

The following example demonstrates the usage of an enumerated datatype.

To display a Yes and a No button in the message box invoked by clicking on the cb_left CommandButton, write the following code in the Clicked Event.
MessageBox ("Hello!", "I understood using " &
            + "enumerated datatypes.", &
            Information!, YesNo!, 1)
HomePrevious Lesson: Variable Declarations
Next Lesson: Accessing Object's Attributes