PowerBuilder – Development vs. Production Mode

Posted on Tuesday, February 22nd, 2011 at 8:20 pm in

You can set up a variety of helpful methods for use while developing an application which you don’t want users to get their hands on when in production. One example of this is my Window Information Service . To make this only available when running from the Powerbuilder IDE use the following steps.

Set up some sort of global application object. The PFC application object is a prime example of this. Here we will use ‘gnv_app’.

Declare a couple of instance variables on the object. Something like

>boolean ib_inPB
application iapp_object

In the open event of your main window you can then do:

 gnv_app.iapp_object = GetApplication()
gnv_app.ib_inPB = (handle(nv_app.iapp_object) = 0)

From Powerbuilder Help:
“As far as Windows is concerned, your application does not have a handle when it is run from PowerBuilder. When you build and run an executable version of your application, the Handle function returns a valid handle for the application.”

Now you can implement your development code inside an “IF gnv_app.ib_inpb THEN…” block.

You might also be interested in