Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 15 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 16.2 ('StockScripter')
Instant purchase and download via GumRoad!

COLUMN

Making Code Pretty 2

Using IDE Scripting for Custom Code Formatting

Issue: 16.2 (March/April 2018)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 13,204
Starting Page Number: 84
Article Number: 16207
Resource File(s):

Download Icon project 16207.zip Updated: 2018-02-28 18:43:06

Related Web Link(s):

http://developer.xojo.com/custom-code-reformatting

Excerpt of article text...

Last fall, in xDev 15.5, I wrote about a new power user feature of Xojo, custom code formatting (http://developer.xojo.com/custom-code-reformatting). This is where you can use a XojoScript to format your code in the IDE the way you want it to look.

At the time the feature was brand new, buggy, and barely documented. The script I wrote about was limited and had some major bugs. I also received feedback about minor errors in the column, and I have since improved my script. So here's Version 2!

Quick Recap

Everyone has their own coding style, so my preferences may not match yours. But I had these goals for my script:

  • every token begins with a lowercase letter (reserved words are already in color, so having them in caps is distracting and overemphasizes them)

  • preserve camelCase for my variable and method names

...End of Excerpt. Please purchase the magazine to read the full article.