Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB - OS information 1

Status
Not open for further replies.

bubbly

Programmer
Mar 28, 2003
74
AE
Is PB platform independent?

If yes, where is the information about the platform or operating system stored??
 
Yes PB is platform independent.

GetEnvironment PowerScript function

Description

Gets information about the operating system, processor, and screen display of the system.

Syntax

GetEnvironment ( environmentinfo )

Argument Description
environmentinfo The name of the Environment object that will hold the information about the environment
Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If environmentinfo is NULL, GetEnvironment returns NULL.

Usage

In cross-platform development projects, you can call GetEnvironment in scripts and take actions based on the operating system. You can also find out the processor (Intel 386 or 486, 68000, and so on). The information also includes version numbers of the operating system and PowerBuilder.
You can call GetEnvironment to find out the number of colors supported by the system and the size of the screen. You can use the size information in a window's Open script to reset its X and Y properties.

---------------------------------------------------
Example:

This script runs another PowerBuilder application and uses the OSType property of the Environment object to determine how to specify the path:

string path
environment env
integer rtn
rtn = GetEnvironment(env)

IF rtn <> 1 THEN RETURN

CHOOSE CASE env.OSType
CASE aix!
path = &quot;/export/home/pb_apps/analyze.exe&quot;
CASE Windows!, WindowsNT!
path = &quot;C:\PB_apps\analyze.exe&quot;
CASE ELSE
RETURN
END CHOOSE

Run(path)
--------------------------------------------------------
For more informations see:
OnlineBook
Application technique
Part 7
General Techniques
Chapter 31
Building an Application for Multiple Platforms
--------------------------------------------------------
 
I do agree to what ever u have said here.

Just an Example

I have an Exe and the associated PBD's, Dll's are available. I am able to run the Exe with the associated file and it works fine.

But remember i do not have PB installed on my machine as well as no PBL's.

In such a case how do i know the operating system it was developed in?

i hope i am clear??
Do we have a way out?
 
You will need the deployment DLLs (aka Virtual Machine) installed as a prerequisite to running the application you created.

What DLL's are needed depend on your version of pb and what you are doing with it (i.e. don't use the rich text control, you can ignore the RTC DLL).

Do a search on &quot;powerbuilder deployment&quot; in the books online at or on your local pc (if installed).
 
The Virtual Machine used is pbvm80.dll.


With this i can only know the version of the PB in which the development took place.

But then it does not give me information about the operating system it was developed?

does it??
 
Which is the interest of this?
If not, in the source program, register it in a window &quot;About&quot;
 
As u said....

in The source program??

Well... i have mentioned that the PBL files are not available...

Well... i guess it is not possible to get the operation system information from the EXE or the PBD files....
 
But I think that the operating system does not have any importance because Pcode (short for pseudocode = PBD) is an interpreted language that's supported on all PowerBuilder platforms. It's the same format that PowerBuilder uses in libraries (PBL files) to store individual objects in an executable state.
 
I am just not bothered about the PowerBuilder platforms... i am interested to know only the operating system which was used while developing the application.

And remember i do not have the .PBL files.... i only have PBDs and associated DLLs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top