{"id":715,"date":"2011-02-22T20:20:13","date_gmt":"2011-02-23T01:20:13","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=715"},"modified":"2021-03-10T19:29:09","modified_gmt":"2021-03-11T00:29:09","slug":"powerbuilder-development-vs-production-mode","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-development-vs-production-mode\/","title":{"rendered":"PowerBuilder &#8211; Development vs. Production Mode"},"content":{"rendered":"<p>You can set up a variety of helpful methods for use while developing an application which you don&#8217;t want users to get their hands on when in production.  One example of this is my <a href=\"http:\/\/anvil-of-time.com\/wordpress\/?p=447\" target=\"_blank\" rel=\"noopener\">Window Information Service<\/a> .  To make this only available when running from the Powerbuilder IDE use the following steps.<\/p>\n<p>Set up some sort of global application object.  The PFC application object is a prime example of this.  Here we will use &#8216;gnv_app&#8217;.<\/p>\n<p>Declare a couple of instance variables on the object.  Something like<\/p>\n<pre name=\"code\" class=\"VB\">&gt;boolean ib_inPB\napplication iapp_object<\/pre>\n<p>In the open event of your main window you can then do:<\/p>\n<pre name=\"code\" class=\"VB\"> gnv_app.iapp_object = GetApplication()\ngnv_app.ib_inPB = (handle(nv_app.iapp_object) = 0)<\/pre>\n<p>From Powerbuilder Help:<br \/>\n<em>&#8220;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.&#8221;<\/em><\/p>\n<p>Now you can implement your development code inside an &#8220;IF gnv_app.ib_inpb THEN&#8230;&#8221; block.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can set up a variety of helpful methods for use while developing an application which you don&#8217;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&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[33,12,16,42],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/715"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":8,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"predecessor-version":[{"id":1930,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/715\/revisions\/1930"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}