{"id":125,"date":"2008-08-21T16:42:57","date_gmt":"2008-08-22T00:42:57","guid":{"rendered":"http:\/\/www.antunkarlovac.com\/blog\/?p=125"},"modified":"2008-08-21T16:42:57","modified_gmt":"2008-08-22T00:42:57","slug":"use-commas-to-separate-arguments-to-debugwrite","status":"publish","type":"post","link":"https:\/\/www.antunkarlovac.com\/blog\/2008\/08\/21\/use-commas-to-separate-arguments-to-debugwrite\/","title":{"rendered":"Use Commas to Separate Arguments to Debug.write()"},"content":{"rendered":"<p>When you want to trace something to the Debugger in OpenLaszlo, you can call the Debug.write() method.<\/p>\n<p style=\"text-align: center;\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-126 aligncenter\" title=\"debugger\" src=\"http:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2008\/08\/debugger.gif\" alt=\"\" width=\"398\" height=\"152\" srcset=\"https:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2008\/08\/debugger.gif 398w, https:\/\/www.antunkarlovac.com\/blog\/wp-content\/uploads\/2008\/08\/debugger-300x114.gif 300w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/p>\n<p>Often, you&#8217;ll want to write the value of something and a label, so that you can identify that output in the debugger, something like:<\/p>\n<p><code>Debug.write(\"subviews: \" + canvas.subviews);<\/code><\/p>\n<p>However, it&#8217;s better to to get into a habit of use commas instead of a plus sign, like so:<\/p>\n<p><code>Debug.write(\"subviews:\", canvas.subviews);<\/code><\/p>\n<p>Debug.write() takes an arbitrary number of arguments, which are comma-separated, and concatenates the output. If any of those arguments are complex objects (such as arrays, references to views, etc.) they&#8217;ll become links. If you click on them, you&#8217;ll be able to inspect the object itself. If you use the plus sign, then the JavaScript runtime will do the concatenation, and you&#8217;ll end up with a string; you won&#8217;t be able to click on the traced statement.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>When you want to trace something to the Debugger in OpenLaszlo, you can call the Debug.write() method. Often, you&#8217;ll want to write the value of something and a label, so that you can identify that output in the debugger, something like: Debug.write(&#8220;subviews: &#8221; + canvas.subviews); However, it&#8217;s better to to get into a habit of &hellip; <a href=\"https:\/\/www.antunkarlovac.com\/blog\/2008\/08\/21\/use-commas-to-separate-arguments-to-debugwrite\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Use Commas to Separate Arguments to Debug.write()<\/span><\/a><!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/125"}],"collection":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":1,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/posts\/125\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.antunkarlovac.com\/blog\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}