{"id":735,"date":"2020-05-11T07:59:00","date_gmt":"2020-05-11T13:59:00","guid":{"rendered":"https:\/\/www.great-white-software.com\/blog\/?p=735"},"modified":"2020-05-09T20:05:19","modified_gmt":"2020-05-10T02:05:19","slug":"pasting-plain-text-code","status":"publish","type":"post","link":"https:\/\/www.great-white-software.com\/blog\/2020\/05\/11\/pasting-plain-text-code\/","title":{"rendered":"Pasting plain text code"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">If, like me, you sometime munge text into code and then want to paste it into the IDE that can sometimes be a real chore<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Unless you happen to know this little trick<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you have plain text lke <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Public Function ToString(extends enumValue as Untitled) as String\n  select case enumValue\n    case Untitled.valueName\n        return \"valueName\"\n    case Untitled.valueName\n        return \"valueName\"\n    case Untitled.valueName\n        return \"valueName\"\nElse\n raise new UnsupportedOperationException\n  end select\nEnd Function\n\n\nPublic Function ToUntitled(extends stringValue as String) as Untitled\n  select case stringValue\n    case \"valueName\"\n        return Untitled.valueName\n    case \"valueName\"\n        return Untitled.valueName\n    case \"valueName\"\n        return Untitled.valueName\n  end select\nElse\n raise new UnsupportedOperationException\nEnd Function\n\nPublic Function Untitled_ToString( enumValue as Untitled) as String\n  select case enumValue\n    case Untitled.valueName\n        return \"valueName\"\n    case Untitled.valueName\n        return \"valueName\"\n    case Untitled.valueName\n        return \"valueName\"\nElse\n raise new UnsupportedOperationException\n  end select\nEnd Function\n\n\nPublic Function Untitled_FromString(stringValue as String) as Untitled\n  select case stringValue\n    case \"valueName\"\n        return Untitled.valueName\n    case \"valueName\"\n        return Untitled.valueName\n    case \"valueName\"\n        return Untitled.valueName\nElse\n raise new UnsupportedOperationException\n  end select\nEnd Function\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">and select it all and copy then, in the IDE select the MODULE, WINDOW, CLASS (not the methods group in any of those) and Paste<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The downside here is that only the FIRST method gets pasted &#8211; but it does get pasted<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So you have to do them one by one<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But its better than nothing<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Works well with a little helper app I&#8217;ll post later than writes methods to extend enums so its easy to convert them to\/from strings <\/p>\n","protected":false},"excerpt":{"rendered":"<p>If, like me, you sometime munge text into code and then want to paste it into the IDE that can sometimes be a real chore Unless you happen to know this little trick If you have plain text lke and select it all and copy then, in the IDE select the MODULE, WINDOW, CLASS (not &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.great-white-software.com\/blog\/2020\/05\/11\/pasting-plain-text-code\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Pasting plain text code&#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_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-735","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/735","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=735"}],"version-history":[{"count":1,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/735\/revisions"}],"predecessor-version":[{"id":736,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/posts\/735\/revisions\/736"}],"wp:attachment":[{"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/media?parent=735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/categories?post=735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.great-white-software.com\/blog\/wp-json\/wp\/v2\/tags?post=735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}