{"id":318,"date":"2010-08-30T20:20:38","date_gmt":"2010-08-31T01:20:38","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=318"},"modified":"2021-03-09T08:13:05","modified_gmt":"2021-03-09T13:13:05","slug":"powerbuilder-gotcha-null-messagebox","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-gotcha-null-messagebox\/","title":{"rendered":"PowerBuilder &#8216;Gotcha&#8217; &#8211; Null Messagebox"},"content":{"rendered":"<p>As with many methods in Powerbuilder, the &#8216;Messagebox&#8217; function returns a NULL if any of the paramenters you send it are NULL. This can be problematic in your &#8216;defensive programming&#8217; situations where you are informing the user of some type of error or condition. For Example:<\/p>\n<pre name=\"code\" class=\"VB\">ls_value = TRIM(data)\nIF Len(ls_value) &gt; 0 THEN\n\tSELECT Max(itemCode)\n\tINTO :ls_check\n\tFROM AB_Part\n\tWHERE itemNo = :ls_value\n\tUSING SQLCA;\n\tIF IsNull(ls_check) THEN\n\t\tMessagebox(Parent.title,&quot;Item &quot; + ls_check + &quot; is not valid!~nPlease enter a valid Item Number.&quot;)\n\t\tRETURN 1\n\tELSE...<\/pre>\n<p>This code does not produce a messagebox since the value of ls_check is NULL thereby causing the messagebox text to be null.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As with many methods in Powerbuilder, the &#8216;Messagebox&#8217; function returns a NULL if any of the paramenters you send it are NULL. This can be problematic in your &#8216;defensive programming&#8217; situations where you are informing the user of some type of error or condition. For Example: ls_value = TRIM(data) IF Len(ls_value) &gt; 0 THEN SELECT&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/318"}],"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=318"}],"version-history":[{"count":8,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/318\/revisions"}],"predecessor-version":[{"id":1807,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/318\/revisions\/1807"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=318"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=318"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=318"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}