{"id":261,"date":"2010-08-06T20:20:47","date_gmt":"2010-08-07T01:20:47","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=261"},"modified":"2021-03-09T01:39:22","modified_gmt":"2021-03-09T06:39:22","slug":"powerbuilder-gotcha-datawindow-find-method","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-gotcha-datawindow-find-method\/","title":{"rendered":"PowerBuilder &#8216;Gotcha&#8217; &#8211; Datawindow Find method"},"content":{"rendered":"<p>The find method on the datawindow is a very useful tool but you should always remember to set the upper limit of the rows to search in excess of the actual rowcount. In simple terms:<\/p>\n<pre name=\"code\" class=\"VB\">dw_1.find(&#039;part_no = 123&#039;, 1, dw_1.rowcount())<\/pre>\n<p><strong>Never do this!<\/strong><br \/>Instead use:<\/p>\n<pre name=\"code\" class=\"VB\">dw_1.find(&#039;part_no = 123&#039;, 1, dw_1.rowcount() + 1)<\/pre>\n<p>or simply<\/p>\n<pre name=\"code\" class=\"VB\">dw_1.find(&#039;part_no = 123&#039;, 1, 99999 )<\/pre>\n<p>This option only if you know 99999 will <strong>always<\/strong> be larger than the number of rows.<\/p>\n<p>Why? It is possible to fall into an endless loop when the find hits the limit of the datawindow rows.<\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The find method on the datawindow is a very useful tool but you should always remember to set the upper limit of the rows to search in excess of the actual rowcount. In simple terms: dw_1.find(&#039;part_no = 123&#039;, 1, dw_1.rowcount()) Never do this!Instead use: dw_1.find(&#039;part_no = 123&#039;, 1, dw_1.rowcount() + 1) or simply dw_1.find(&#039;part_no =&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[21,12],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/261"}],"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=261"}],"version-history":[{"count":8,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/261\/revisions"}],"predecessor-version":[{"id":1776,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/261\/revisions\/1776"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=261"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=261"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=261"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}