{"id":1479,"date":"2012-09-06T18:40:06","date_gmt":"2012-09-06T23:40:06","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=1479"},"modified":"2021-03-11T12:45:17","modified_gmt":"2021-03-11T17:45:17","slug":"powerbuilder-gotcha-strings-describe-and-position-attributes","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-gotcha-strings-describe-and-position-attributes\/","title":{"rendered":"PowerBuilder &#8216;Gotcha&#8217; &#8211; Strings, Describe and Position Attributes"},"content":{"rendered":"<p>So I&#8217;m getting the position attributes of a column in a datawindow to aid in the display of another visual object.<\/p>\n<p>What I initially coded was this:<\/p>\n<pre name=\"code\" class=\"VB\">ll_open_x = Long(adw.describe(as_colname + &#039;.X&#039;) + &amp;\n adw.describe(as_colname + &#039;.height&#039;)) + 10<\/pre>\n<p>I run the window and my visual object is no where to be seen.<\/p>\n<p>Looking in the debugger I see that ll_open_x is being set to 72270!<\/p>\n<p>Fixed code is this:<\/p>\n<pre name=\"code\" class=\"VB\">ll_open_x = Long(adw.describe(as_colname + &#039;.X&#039;)) + &amp;\n Long(adw.describe(as_colname + &#039;.height&#039;)) + 10<\/pre>\n<p>Since the Describe method always returns a string the values &#8217;72&#8217; and &#8216;270&#8217; were simply being concatenated prior to being converted to a long.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I&#8217;m getting the position attributes of a column in a datawindow to aid in the display of another visual object. What I initially coded was this: ll_open_x = Long(adw.describe(as_colname + &#039;.X&#039;) + &amp; adw.describe(as_colname + &#039;.height&#039;)) + 10 I run the window and my visual object is no where to be seen. Looking in&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":[21,12,16],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1479"}],"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=1479"}],"version-history":[{"count":5,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1479\/revisions"}],"predecessor-version":[{"id":2053,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/1479\/revisions\/2053"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=1479"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=1479"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=1479"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}