Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need a QB code beautifier...
#1
... Yeah, I am trying to surf among my old files to release some stuff with available source code, but I never indented back then, so the code is really ugly.

I've found a QB beautifier at Alipha's homepage, but it screws up the code (removes the ":" from the labels, mysteriously :???: ).

Anyone knows about a QB source code beautifier which actually works? I *need it* Wink
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#2
A beautifier? What actually is it :???:.
Reply
#3
It is a program which takes ugly code and indents it correctly. Some of them even rearrange parts of your code to make it more readable, i.e. they move DECLARE SUBs to the beginning, place all TYPE DEFINITIONs together and such.

I have one for PowerBasic, but it doesn't recognize many QB structures so it doesn't work.
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#4
Well there are two indentors in the files section
http://qbasicnews.com/files/dent.bas
http://qbasicnews.com/files/id.bas

Those can do some nice work to code ;-) But they may not be what you're looking for..
Reply
#5
Thank you, wildcard. I will try them. Indentation is what I am looking for, at least to make that old spaghetti code more readable Wink

(self note: look in the archive section before asking Wink )
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#6
Files section? :o Here? Where is this?
Antoni
Reply
#7
I have tried both beautifiers with my jpeg viewer. Both made it fail after the process. Does it mean my code is beautiful enough? :???:


I have found a qb beautifier not ruining the programs, it compiles only in PDS (command line), takes a lot of parameters and it's 32K of source:
http://www.geocities.com/aliphax/files/qbb.bas
By editing the lines longer than 256 chars you can make it work in PDS' IDE. Someone should program a beautifier of beautifiers...
Antoni
Reply
#8
Quote:Files section? :o Here? Where is this?

There isn't a "proper" files section just http://qbasicnews.com/files where I've uploaded files that people needed.
Reply
#9
Making a beautifier would be cake Smile

Just scan for 'openers' and 'closers' for indenting. 'Openers' are FOR, DO, WHILE, etc... there's a bit of trickiness to IF THEN ELSE END IF but it's not hard, I did it all in an IDE before.

I say make your own because it'd be able to do all the neat things you wanted, and in fact it's a good idea I might consider. You could group functions and subs at the beginning, and perhaps even alphebetically. :wink:
__________________________________

Mr Toad
Blue Castle Productions
Reply
#10
  • 1. DECLAREs on the very top, alphabetically
    2. then the metacommands
    3. then the CONSTants
    4. then the DIM SHAREDs
    5. then the DIMs and any externals
    6. then somesource code:
    • 1. No multi's grouped with :
      2. 3 spaces (1 tab) after opening tag
      3. 3 spaces (1 tab) back before closing tag
      4. No number labels
    7. SUBs in a group on the back, alphabetically sorted
    8. FUNCTIONs on the very back, alphabetically

Here are some things you might put in your proggie Wink
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)