IT-Berater: Theo Gottwald (IT-Consultant) > Source Code and Discussions

Code-Formatter PB 10

(1/60) > >>

Theo Gottwald:
This is our first community project - a Code-Formatter for PB 9.
Of course it should be extended also to PB 10 immediately when its available.
But anyway - maybe its not yet perfect on your code?

Tweak it, and post the improved version and the List of changes you did.
Let's see if we can get this Project forward together.

Added: I Have changed the Title as it looksl ike that the Code-Formatter now is ready for PB 10.
I'LL also remove old versions now.

Paul Elliott:
Ok, here's my little contribution.

Added ability to split multiple Global/Local variables out to 1 per line and line up the AS info.
It could be expanded to handle DIM & STATIC but I wasn't worried about them.

Redid the TAB expansion as pointed out to me.

Think I semi-fixed the space problem with +=  -=  *=  OR=  AND= . They compile with a space
before the = but it just doesn't look right to me.

Not sure why the following got unfixed:
original at least 2 spaces on left

--- Code: ---  s$ = $Title
   i = INSTR(s$, "(")
   s$ = LEFT$(s$, i - 1)
  Prgzqnam = s$

--- End code ---

after no spaces on left

--- Code: ---s$ = $TITLE
i = INSTR(s$, "(")
s$ = LEFT$(s$, i - 1)
Prgzqnam = s$

--- End code ---

not sure if it matters but this is part of a Callback Function. reran original program and it does the
same output. so I didn't mess up something. just couldn't find out why.

05/09/2011  Please note: new zip is in message dated 05/09/2011. Small fixes.

Paul Elliott:
Found the problem but not the solution ( yet ).

It never allowed for Callback Function and thinks it's still in the middle of some construct which has
reset the indent level.

If someone else would care to handle this, I won't get upset.  ;)

Also noticed that "function" & "sub" are checked twice in a CASE statement. Should be fixed but
no hurry.

And if you figure out how to align the AS items of a Type that would be helpful.

Paul Elliott:
Fixed Callback Function not indenting the code of the function.

zip file updated as of 05/09/2011 01:09pm ( or around 7:10pm here ).

If you have downloaded the v2 zip from the previous message, you probably want this new one.

Not sure if I can delete it from the previous message or not.


Paul Elliott:
Made some minor changes for v2a. Updated 6/21/2011 around 08:30am ( or 02:30pm here ).

Got Global/Regsiter/Dim/Local/Static all into 1 routine for splitting variables.

There are still some that I don't handle.
Multiple AS type on 1 line.
Multiple AS type  on line split with "_" on end.
Lines mixing old style ( w/ & ! $ ... ) on same lines with different AS type but this should show
 up as compile error.

Am looking at Type/End Type to align the AS type. But this routine would also not really fit into
the way the program was originally structured.

Any  of the 18 who downloaded v2 should download v2a.
I'll see if I can remove v2 zip just to avoid confusion.

Any comments are welcome ( unless you're just going to yell at me  ;)  ).


[0] Message Index

[#] Next page

Go to full version