Author Topic: Code-Formatter PB 10  (Read 160126 times)

0 Members and 1 Guest are viewing this topic.

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #135 on: December 08, 2011, 12:14:12 PM »
Hi Theo,

The final code is at the top to download! I put the code but always pure whom I've changed something! Yesterday, I'm not sorry to come!

regards Peter

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1050
  • User-Rate: +30/-4
  • Gender: Male
    • it-berater
Re: Code-Formatter PB 10
« Reply #136 on: December 08, 2011, 12:42:30 PM »
Quote
Ich arbeite immer noch an DoFormat jede andere Funktion kann im Moment geändert werden also am aussehen oder der Progressbar oder oder oder! Ich könnte auch manchmal ein Feedback brauchen was mit der Formatierung nicht Funktioniert!

Peter says that he is actually working on the "DoFormat", but that any other function in the provided code can be cahnged by anybody want to take part in the project.

However i suggest just to wait until peter gives the sign that he's done. This way we make step by step.

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #137 on: December 08, 2011, 01:12:48 PM »
Hello,
May have DoFormat and all the functions depend on it included in a separate #INCLUDE any work on it now!

regards Peter
« Last Edit: December 26, 2011, 10:34:26 AM by Peter Weis »

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #138 on: December 10, 2011, 03:25:41 PM »
Hello,

A couple observations.

1) move the #PBFORMS check/reformat into RebuildLine where it belongs. that will remove a
major indent that isn't needed.

2) it doesn't seem to reformat a line with only 1 variable. did you mean to do this change?

3) I am seeing problems with DIM x(1, 2) as long   and DIM x(a - 1, b - 1) as long. see if it
works with TO or : instead of the , in the parens.

4) nothing seems to work under the Class. suggest you get Larry charlton's GDI Plus code
from the PB forums and include all the INCs into the main BAS file for testing. Unless you have
several Class programs from different programmers available.

5) I think there is a much simpler way to handle the split variable routine and adds no multiple
scans trying to figure out parts of the line but haven't been able to figure out exactly what
your function is doing.

6) how are you planning to handle:
Code: [Select]
dim x as long, _
     y, _
     z as dword

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #139 on: December 10, 2011, 05:05:34 PM »
Hi Paul,
 I will look at the issues and work through the points piece by piece!
 But thank you that you have my attention!
 regards Peter

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1050
  • User-Rate: +30/-4
  • Gender: Male
    • it-berater
Re: Code-Formatter PB 10
« Reply #140 on: December 10, 2011, 05:37:58 PM »
Peter asked me to translate it.

Hello,

A couple observations.
[Einige Beobachtungen]

1) move the #PBFORMS check/reformat into RebuildLine where it belongs. that will remove a
major indent that isn't needed.


[Verschiebe das  #PBFORMS nach "RebuildLine" wo es hignehört. Das sollte einen wichtigen ungewollten Einzug entfernen.]

2) it doesn't seem to reformat a line with only 1 variable. did you mean to do this change?

[Eine Zeile mit nur einer Variable wird nicht formattiert - ist das Absicht?]

3) I am seeing problems with DIM x(1, 2) as long   and DIM x(a - 1, b - 1) as long. see if it
works with TO or : instead of the , in the parens.


[Ich sehe probleme mit DIM ... s.o.] Das scheint nicht zu gehen.
 
4) nothing seems to work under the Class.
[ Alles nach CLASS scheint nicht zu funktionieren.]

suggest you get Larry charlton's GDI Plus code from the PB forums and include all the INCs into the main BAS file for testing.
[Hol dir einfach Larry Charltons GDI Plus Code aus dem PB-Forum und include das mal in dein Testfile]

Unless you have  several Class programs from different programmers available.
[Ausser du hast schon genug CLASS-Testfiles von verschiedenen Programmierern]

5) I think there is a much simpler way to handle the split variable routine and adds no multiple
scans trying to figure out parts of the line but haven't been able to figure out exactly what
your function is doing.


[Ich denke dass es beim formattieren der Variablen auch einfacher gehen sollte. Aber ich habe da auch nicht alles verstanden was du da machst]

6) how are you planning to handle:
Code: [Select]
dim x as long, _
     y, _
     z as dword
[/color]


[Wie willst du so einen Fall (s.oben) handhaben?]
« Last Edit: December 10, 2011, 05:40:12 PM by Theo Gottwald »

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #141 on: December 10, 2011, 08:57:26 PM »
An added note to my #5 ( just so you know it is possible ) I added about 50 lines of code and
managed to handle the code fragment I posted. It may be possible that I can shrink it but it
works for me and I may just leave it as is. Half the battle of working on a new function is
knowing that it can be solved.


Question:  Isn't anyone else testing this? I saw that the latest source has been downloaded
14 times. I do admit that the code is tough to follow ( I never did understand the RebuildLine
routine when first working on the split variable ) but the more code by different programmers
that it gets run against then the better the program will be. Even if you don't use the split
variable function.



Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #142 on: December 11, 2011, 03:36:19 PM »
Hi Paul,
 I once fixed a bug.
 The error in DIM x (1, 2)

 regards Peter
« Last Edit: December 26, 2011, 10:34:50 AM by Peter Weis »

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #143 on: December 11, 2011, 09:00:52 PM »
Hi Paul,
 I think that we should dissolve the or. What do you think?

from:
Code: [Select]
dim x as long, _
     y, _
     z as dword


to:

Code: [Select]
    dim x as long
    dim y as long
    dim z as long

 regards Peter

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1050
  • User-Rate: +30/-4
  • Gender: Male
    • it-berater
Re: Code-Formatter PB 10
« Reply #144 on: December 12, 2011, 09:03:37 AM »
looks good to me.

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #145 on: December 12, 2011, 02:31:19 PM »
I take it that you wrote the output by hand? Notice the type of variables and spacing.

Don't forget to allow for multiple variables/types per individual line and remarks on each line.

« Last Edit: December 12, 2011, 02:33:04 PM by Paul Elliott »

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #146 on: December 12, 2011, 08:07:21 PM »
Hello,
 've Added new button for the underscore! The function is not yet. Who should the button is selected, the out come of it!

 input:
Code: [Select]
DIM a, _
 B as integer

 output
Code: [Select]
  Dim a as integer
  Dim b as integer
Who does not:

Code: [Select]
     Dim a, _
         B as integer

 regards Peter

« Last Edit: December 26, 2011, 10:35:27 AM by Peter Weis »

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #147 on: December 12, 2011, 08:54:01 PM »
Why not have it as a normal part of "split variables" ?

I don't see the reason for a new option.


Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #148 on: December 12, 2011, 09:04:40 PM »
Hi Paul,
 I can have it too. Always comes out the Sun

Code: [Select]
    Dim a as integer       ' Test
    Dim b as integer

 But there are people who like to underscore

 regards Peter














Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
  • Gender: Male
Re: Code-Formatter PB 10
« Reply #149 on: December 13, 2011, 09:12:31 PM »
Hello,
  I got a bit further today! Wen Replace underscore is off! The result looks as follows!

input:
Code: [Select]
LOCAL a, b, _   'kdsjfjasdkfj
        c AS INTEGER           

output:

Code: [Select]
LOCAL    a, _                                           'kdsjfjasdkfj
         b, _
         c                          AS INTEGER   


 regards Peter
« Last Edit: December 26, 2011, 10:43:50 AM by Peter Weis »