Formatter tool

Working on new editor enhancements?
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Thanks Leigh, That is fast :)

Ok first topic, my formatter tool does not catch 'Forever' keyword.
Any other bugs found ?

Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

New version, finds 'forever' and also 'structure' who was in before, but was kicked out by mistake :)

New version below

Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

New version, little bug removed.
2002/10/22 New Version below again :)
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Thanks to Plouf for his 'nice' source to test the new routines :)
This version wil format this kind of code correct.

Code: Select all

Select kkeyCase 1
  If player > 0
    nstring$ = "CV"
    If player = 1
      SendNetworkData(ClientID,nstring$,2) :Else
    SendNetworkData(ConnectionID,nstring$,2) :EndIf
  EndIf
  Gosub ClearValues
Case 2
New Version...Below

Code: Select all

--- snip ---


Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Just a quick question. I am new and I would actualy like advice, shouldn't you tab in after a 'select' case? I have been just wondering because the tool doesn't do that at the present time.

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

I dit not do that, because is you have much code after last 'Case' , it seems there is something missing, there are two tabs.
That's wy i prefered to do the same as If Else Endif.

Code: Select all

Select a
Case 1
  blabla
Case 2
  blabla
EndSelect


Select a
  Case 1
    blabla
  Case 2
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla   ; not so nice, looks like something is missing here
EndSelect


If
  blabla
Else
  blabal
EndIf


Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

Code: Select all

Select a
  Case 1
    blabla
  Case 2
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla
    blabla   ; not so nice, looks like something is missing here
EndSelect
It may not look "nice" but it's the correct way to program. :)


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by plouf.

depended on the programmer

btw bericko your tool catch this one but the source
is still not corectly formated (after this it has problem again)

Christos
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> depended on the programmer

I've always read that anything inside a block/loop/procedure is supposed
to be indented, as it clearly shows what belongs inside it. This rule
would therefore logically apply to 'Select...EndSelect' blocks too.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

Sorry, my other editor wich has on the fly formatting (GFA Basic), does format the same, no indent after select.
Select-case is not the same as if-endif.

So I'm NOT going to do it :) (mmmmm.... i read this elsewhere)

Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.
Originally posted by plouf
btw bericko your tool catch this one but the source
is still not corectly formated (after this it has problem again)
Mmm....very strange coding style....i get dizzy if a look at it :)


:)

Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Could it maybe be an option or point me in the place where I could add this?

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

It must be add at 3 places, il take a look later, will include with a extra argument to switch of/off.
BTW new version is comming.....default was also missing in selct-case


Regards,

Berikco

http://www.benny.zeb.be
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by pusztry.

Thanks for the great tool. I realy appreciate your time on this.

- Ryan


WinXP, PIII 800 MHz, 512MB RAM, SB Live 5.1, NVidia TNT 2 Ultra
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by Berikco.

A dozen of people asked me to put it in.....Thanks for the e-mails and flowers :)
New version below

Regards,

Berikco

http://www.benny.zeb.be
Post Reply