{"id":967,"date":"2020-11-09T07:31:00","date_gmt":"2020-11-09T14:31:00","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=967"},"modified":"2020-11-06T07:38:18","modified_gmt":"2020-11-06T14:38:18","slug":"is-it-built-in-or","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2020\/11\/09\/is-it-built-in-or\/","title":{"rendered":"Is it built in or &#8230;"},"content":{"rendered":"\n<p>Xojo has a pretty handy language feature called &#8220;extension methods&#8221;<\/p>\n\n\n\n<p>They can be used by anyone to add functionality to any existing class. And they cane\/have been used by Xojo to do exactly this.<\/p>\n\n\n\n<p>For instance, the currency class has no built in functions to convert itself to a string, from a string, etc. Yet when you enter code like<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Dim c As Currency\n\ns = Currency.<\/code><\/pre>\n\n\n\n<p>and press tab you will see various methods presented. <\/p>\n\n\n\n<p>You can see some of this when you select one option and then view the hint at the bottom of the editor<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"525\" height=\"113\" src=\"https:\/\/i0.wp.com\/www.great-white-software.com\/blog\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-06-at-7.35.33-AM.png?resize=525%2C113&#038;ssl=1\" alt=\"\" class=\"wp-image-968\" srcset=\"https:\/\/i0.wp.com\/www.great-white-software.com\/blog\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-06-at-7.35.33-AM.png?w=714&amp;ssl=1 714w, https:\/\/i0.wp.com\/www.great-white-software.com\/blog\/wp-content\/uploads\/2020\/11\/Screen-Shot-2020-11-06-at-7.35.33-AM.png?resize=300%2C64&amp;ssl=1 300w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/figure>\n\n\n\n<p>Normally it doesnt matter that a function is or isnt done this way.<\/p>\n\n\n\n<p>Unless you expect things in XojoScript to also have these functions. They wont exist because the module(s) that provide all these handy functions are not part of the framework available to XojoScript.<\/p>\n\n\n\n<p>And so code that would work in Xojo may not work in XojoScript.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Xojo has a pretty handy language feature called &#8220;extension methods&#8221; They can be used by anyone to add functionality to any existing class. And they cane\/have been used by Xojo to do exactly this. For instance, the currency class has no built in functions to convert itself to a string, from a string, etc. Yet &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2020\/11\/09\/is-it-built-in-or\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Is it built in or &#8230;&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-967","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/comments?post=967"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/967\/revisions"}],"predecessor-version":[{"id":969,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/967\/revisions\/969"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}