PDA

View Full Version : Did you know: Reformatting a Script



danbaron
01-02-2010, 00:48
I am translating a program (script) I wrote, from another implementation of
Basic, to thinBasic.

All of the text of the program is in uppercase.

So, all of the keywords, GLOBAL, LOCAL, CONST, FOR, ELSE, WHILE, etc., are in
uppercase.

In thinAir, keywords are normally automatically formatted in mixed case, Global,
Local, Const, For, Else, While, etc.

So, in the program I am translating, I wanted to reformat the uppercase keywords,
into the mixed case of thinAir.

At first, it seemed that the only way to do it, was to put the cursor at the end of each
line I wanted to change, and then to press enter/return.

Fortunately, there is an easier way, using three commands from the Edit menu.
All of the keywords are reformatted into mixed case, by first executing, "Select
All" (Ctrl+A), then, "Comment" (Ctrl+B), and finally, "Uncomment"
(Ctrl+Shift+B).

I think that, executing those three commands in that sequence, has the effect of
a, "Reformat All" command.

DTB.

Michael Clease
01-02-2010, 00:59
In the previous version of thinAir it had a code formating option and that retabbed the code and created nice structured layout but Eros probably hasnt had time to implement it yet.

ErosOlmi
01-02-2010, 07:35
@danbaron
Nice trick dan.
I'm currently working to add the possibility to have Mixed/Upper/Lower case option in editor.

@Michael
Yes there was a reformatting utility in old thinAir.
As soon as I will have some time I will revamp it.
Thanks for remembering.