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 PowerScript Reference.

Properties

Environment property

Datatype

Description

CharSet

CharSet (enumerated)

The international character set used by PocketBuilder. Values include:

  • CharSetAnsi!

  • CharSetUnicode!

  • CharSetDBCS!

  • CharSetDBCSJapanese!

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.

CurrentTrustMode

Integer

The assigned trust level of the process based on whether the certificat is a device’s privileged store. Values are:

  • 1 – The operating system trusts the program to run, but restricts certain function calls such as making phone calls or updating the Subscriber Identity Module (SIM)

  • 2 – The operating system trusts the program to perform any function calls

DeviceID

String

Unique value for the device hosting the operating system.

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

Long

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 3 for Windows CE 2002 , 4 for Windows CE 2003, and 5 for Windows Mobile 5 and 6.

OSMinorRevision

Integer

The point release of the operating system. For example, this value would be 0 for Windows CE 2002, 20 for Windows CE 2003, 1 for WIndows Mobile 5, and 2 for Windows Mobile 6.

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 PocketBuilder.

PBFixesRevision

Integer

The maintenance version of PocketBuilder.

PBMajorRevision

Integer

The major version of PocketBuilder.

PBMinorRevision

Integer

The point release of PocketBuilder.

PBType

PBTypes (enumerated)

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

PhoneCapable

Boolean

Indicates whether the device is capable of using the phone system, but does not determine whether subscriptions or phone accounts are enabled.

ScreenHeight

Long

Height of the screen in pixels.

PowerBatteryCharging

Boolean

Indicates whether the battery is being charged.

PowerBatteryDataValid

Boolean

Indicates whether the values for PowerBatteryCharging, PowerBatteryFlags, PowerBatteryLifeRemaining, and PowerBatteryPercentage are valid. Values are:

  • TRUE – Power battery values are valid

  • FALSE – The device is unable to report the power battery values

PowerBatteryFlags

ULong

Reports the device battery charge status flags. Values and their meanings are:

  • 0 Unknown

  • 1 High charge state

  • 2 Low charge state

  • 4 Critically low charge state

  • 8 Currently charging (PowerBatteryCharging is true)

  • 128 No battery is present

Combinations of the above values are possible. For example, a value of 10 would mean that the battery has a low charge state but is also currently charging.

PowerBatteryLifeRemaining

ULong

Estimated battery life remaining in seconds.

PowerBatteryPercentage

Integer

Percentage of full battery charge remaining.

PowerLineBackup

Boolean

Device is on backup power.

PowerLineDataValid

Boolean

Determines whether the values for PowerLineOn and PowerLineBackup are valid. Values are:

  • TRUE – Power line values are valid

  • FALSE – The device is unable to report the power line values

PowerLineOn

Boolean

Device is plugged in to main power source.

ScreenWidth

Long

Width of the screen in pixels.

Win16 (obsolete)

Boolean

Indicates whether the operating system in which the application executable is running is 16-bit (true) or 32-bit (false).

Functions

Environment function

Datatype returned

Description

ClassName

String

Returns the name assigned to the object.

GetContextService

Integer

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

GetParent

PowerObject

Returns a reference to the name of the parent object.

TypeOf

Object

Returns the type of the object.