{"id":42,"date":"2019-06-01T20:54:02","date_gmt":"2019-06-01T20:54:02","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=42"},"modified":"2019-06-21T01:38:06","modified_gmt":"2019-06-21T01:38:06","slug":"add-item-from-clipboard","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2019\/06\/01\/add-item-from-clipboard\/","title":{"rendered":"Add item from clipboard"},"content":{"rendered":"\n<p>A post on the forums got me thinking that there might be a way to simply add a whole class, module etc to a project just from code copied from the forums.<\/p>\n\n\n\n<p>So I sat and whipped up a little IDE script that takes a clipboard and will convert it to a class or module. Now there are some tricks. One is that because certain aspects of the Xojo text format can be a bit ambiguous there&#8217;s a little more markup involved. Nothing really onerous though.<\/p>\n\n\n\n<p>The following is a simple module<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Module Module1\n  Sub Untitled()\n\t\t  \n  End Sub\n\n  Property mUntitled1 As Integer\n\n  ComputedProperty untitled1 as integer\n    Get\n      Return mUntitled1\n    End Get\n    Set\n     mUntitled1 = value\n    End Set\n  End ComputedProperty\nEnd Module\n\n<\/code><\/pre>\n\n\n\n<p>When copied to your clipboard and the script is run you get a module on your desktop on macOS. Sorry about this but I haven&#8217;t tried this on Windows or Linux yet. And I can&#8217;t insert it into the project directly with IDE scripting as it work today \ud83d\ude41 <br>The following gives a class on your desktop<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class TOperInfo\n  enum TOperType \n    OperNull\n    OperMult\n    OperDiv\n    OperPlus\n    OperSous\n  end enum\n\n  property Priority as Uint8\n  property NbOper as TOperType\n\n  Sub Constructor( priority as Uint8, nbOper as TOperType)\n    self.priority = priority\n    self.NbOper = nbOper\n  end sub\nend class<\/code><\/pre>\n\n\n\n<p>Enjoy ! <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A post on the forums got me thinking that there might be a way to simply add a whole class, module etc to a project just from code copied from the forums. So I sat and whipped up a little IDE script that takes a clipboard and will convert it to a class or module. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2019\/06\/01\/add-item-from-clipboard\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Add item from clipboard&#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-42","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\/42","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=42"}],"version-history":[{"count":3,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/42\/revisions"}],"predecessor-version":[{"id":149,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/42\/revisions\/149"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=42"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=42"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}