Environment object

The Environment object is a system structure used to hold information about the computing platform the PowerBuilder application is running on. You populate the Environment object using the GetEnvironment function.

The Environment object has no events.

For more information about the GetEnvironment function, see the section called “GetEnvironment” in PowerScript Reference.

Properties

Environment property

Datatype

Description

CharSet

CharSet (enumerated)

The international character set used by PowerBuilder. Values include:

  • CharSetAnsi!

  • CharSetUnicode!

  • CharSetDBCS!

  • CharSetDBCSJapanese!

The values CharSetAnsiArabic! and CharSetAnsiHebrew! are not valid choices in PowerBuilder 6 or later.

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

CPUType

CPUTypes (enumerated)

The type of CPU. For a complete list of CPUTypes values, see the Enumerated tab of the Browser.

Language

LanguageID

(enumerated)

Specifies the value of the language setting for the machine. For a complete list of LanguageID values, see the Enumerated tab of the Browser.

MachineCode

Boolean

Specifies whether the application executable is machine code (compiled). Values are:

TRUE -- Executable is machine code.

FALSE -- Executable is not machine code (pseudo-code).

NumberOfColors

LongLong

Number of colors on the screen.

OSFixesRevision

Integer

The maintenance version of the operating system.

OSMajorRevision

Integer

The major version of the operating system. For example, this value would be 4 for Windows 95, 98, ME, or NT 4.x, 5 for Windows 2000, XP, or 2003, 6 for Vista, Windows Server 2008, or Windows 7, and 10 for Windows 10.

OSMinorRevision

Integer

The point release of the operating system. For example, this value would be 0 for Windows Server 2008 and Vista, 1 for Windows XP or Windows 7, 2 for Windows Server 2003 and 64-bit XP, and 10 for SunOS 5.10 (Solaris 10).

OSType

OSTypes (enumerated)

Operating system or environment. For a complete list of OSType values, see the Enumerated tab of the Browser.

PBBuildNumber

Integer

The build number of this version of PowerBuilder.

PBFixesRevision

Integer

The maintenance version of PowerBuilder.

PBMajorRevision

Integer

The major version of PowerBuilder.

PBMinorRevision

Integer

The point release of PowerBuilder.

PBType

PBTypes (enumerated)

Version of the PowerBuilder product. For a complete list of PBType values, see the Enumerated tab of the Browser.

ProcessBitness

Integer

Identifies whether the application is a 32-bit or 64-bit process. Values are:

32 -- stands for 32-bit

64 -- stands for 64-bit

ScreenHeight

Long

Height of the screen in pixels.

ScreenWidth

Long

Width of the screen in pixels.

Win16 (obsolete)

Boolean

Indicates the type of the operating system in which the application executable is running. Values are:

TRUE -- Executable is running under a 16-bit operating system.

FALSE -- Executable is running under a 32-bit operating system.


Functions

Environment function

Datatype returned

Description

ClassName in PowerScript Reference

String

Returns the name assigned to the object.

GetContextService in PowerScript Reference

Integer

Creates a reference to a context-specific instance of the specified service.

GetParent in PowerScript Reference

PowerObject

Returns a reference to the name of the parent object.

TypeOf in PowerScript Reference

Object

Returns the type of the object.