Results 1 to 3 of 3

Thread: Did you know: Reformatting a Script

  1. #1
    thinBasic MVPs danbaron's Avatar
    Join Date
    Jan 2010
    Location
    California
    Posts
    1,378
    Rep Power
    152

    Did you know: Reformatting a Script

    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.
    "You can't cheat an honest man. Never give a sucker an even break, or smarten up a chump." - W.C.Fields

  2. #2
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    160

    Re: Did you know: Reformatting a Script

    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.
    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,817
    Rep Power
    10

    Re: Did you know: Reformatting a Script

    @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.
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •