Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / DBA Tidy V1.2 (For DBC or DBP)

Author
Message
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 15th Apr 2007 20:27 Edited at: 15th Apr 2007 20:46
I've recently updated DBA Tidy - an old program of mine from back in 2001 and thought I'd post the new version here.

Although it's not written in Dark Basic, it's a utility for Dark Basic .DBA files which will correctly indent the lines.



If your source code is not indented, or is partially/incorrectly indented, DBATidy will sort it out for you - especially useful if your project is quite large and indenting it properly has become too big a task.

It's also essential if you need to post code on the forums as many of the more experienced coders won't bother with unindented code as it is too difficult to follow.

[Edit] Oops - forgot to mention the one single rule to using it:

This probably won't affect the majority of you, but if - like me - your programs have labels scattered around your program like 'EnemyCodeStartsHere:' then DBATidy can confuse them with the start of a procedure and look for an associated Return (the labels used are identical).

So, the rule is that labels on their own on a line are the start of a Gosub procedure. ALL other labels MUST have a REM after the colon.

Examples:

MyProcedure:
Return


On it's own on a line, this label is the start of a procedure and DBATidy will start indenting. Do not add ANYTHING after the colon on the end.

MyLabel: Rem A non-procedure label

With this label, the Rem tells DBTidy that it's not the start of a procedure and does not trigger indentation.

Download file attached.

TDK_Man

Attachments

Login to view attachments
Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 16th Apr 2007 19:03
wow thank you, you updated this tool, wich now becomes useful for me, because you added the possibility to change the indent value

well done!!!
Satchmo
18
Years of Service
User Offline
Joined: 29th May 2005
Location:
Posted: 17th Apr 2007 04:54 Edited at: 17th Apr 2007 04:56
Really nice tdk. Now i wont need to do it myself, lol!

What never ceases to amaze me is the outstanding quality of everything you make. Good work, keep it up.

Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 11th May 2007 13:57 Edited at: 11th May 2007 14:00
could you also make it so it makes spaces with select, case and type statements:

select x
____case 1
________do something
____endcase
____case 2
________do something else
____endcase
endselect

and with:

select x
____case 1:do something:endcase
____case 2:do something else:endcase
endselect

and with:

type
____x as integer
____y as float
endtype

?????????????????????? please?

because now it just makes:

type
x as integer
y as float
endtype

select x
case 1:do something:endcase
case 2:do something else:endcase
endselect

select x
case 1
do something
endcase
case 2
do something else
endcase
endselect


(hope this makes sense)
MartinS
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location: Rochester, NY
Posted: 11th May 2007 21:43
Awesome! This'll be good for tidying up the FPSC source.

G2L

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 12th May 2007 02:18
Quote: "could you also make it so it makes spaces with select, case and type"


Yes sure - will do.

It was written years ago for DB Classic - well before DBPro and FPSC were even thought of and before DBC had Select..Case.

I only noticed it didn't cater for Select and Case the other day and made a mental note to sort it out.

TDK_Man

MartinS
18
Years of Service
User Offline
Joined: 15th Dec 2005
Location: Rochester, NY
Posted: 12th May 2007 07:49
Quote: "[quote]Quote: "could you also make it so it makes spaces with select, case and type""


Yes sure - will do.[/quote]

Cool! Would it also be possible for it to change the commands to UPPERCASE, lowercase, or First Letter Capitalized? For example have a options dialog where the user could choose - and the DBA Tidy would do all the hard work.

G2L

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 14th May 2007 04:58
Here's version 1.3! (Zip file attached below).

It now includes Select and Case as well as the ability to convert DB keywords into lower case, upper case or capitalized words - as requested.

Converting keywords isn't super fast at the moment, but it does work - and I have an idea to speed it up for V1.4.

TDK_Man

Attachments

Login to view attachments
Sixty Squares
17
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 15th May 2007 04:27 Edited at: 15th May 2007 04:39
Amazing! I love this program I am going to use it a lot. It works very well. Finally, I can neaten up my source code (which is always extremely messy) with the click of a button

A sugguestion: Maybe it could indent types too (I know they aren't in DBC though...).

Something I found: I found that it doesn't like 20 liners very much, but then again you can't really indent those

Master Xilo
17
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 15th May 2007 11:58
very well again

but it should not check for labels between "remstart" and "remend"
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 16th May 2007 10:40
Type..EndType and RemStart..RemEnd on my list for the next update...

TDK_Man

Turoid
20
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 17th May 2007 01:00
That is just soo usefull! Thanks tdk.

I am awesome and always right.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 17th May 2007 04:05
V1.4 now ready and waiting to be downloaded. Now includes Type..EndType indenting as well as ignoring all indentation inside Remstart..Remend blocks.

TDK_Man

Login to post a reply

Server time is: 2024-03-29 08:12:55
Your offset time is: 2024-03-29 08:12:55