How to post code in forum other than copy/paste? Thanks.
Using https://gist.github.com is a good way. It also lets people do small forks of your code and change them to show you how to fix it.
Also, when you post code here, the easiest way is to wrap it with [code]…[/code] like this:
Which will do this: