Posts: 6,419
Threads: 74
Joined: Mar 2002
... 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*
Posts: 1,845
Threads: 44
Joined: Aug 2002
A beautifier? What actually is it :???:.
Posts: 6,419
Threads: 74
Joined: Mar 2002
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.
Posts: 1,138
Threads: 211
Joined: Feb 2020
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..
Posts: 6,419
Threads: 74
Joined: Mar 2002
Thank you, wildcard. I will try them. Indentation is what I am looking for, at least to make that old spaghetti code more readable
(self note: look in the archive section before asking
)
Posts: 1,407
Threads: 117
Joined: Dec 2002
Files section? :o Here? Where is this?
Antoni
Posts: 1,407
Threads: 117
Joined: Dec 2002
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
Posts: 1,138
Threads: 211
Joined: Feb 2020
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.
Posts: 18
Threads: 4
Joined: Nov 2002
Making a beautifier would be cake
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
Posts: 1,845
Threads: 44
Joined: Aug 2002
- 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