Code-Formatter PB 10

Started by Theo Gottwald, January 18, 2011, 07:58:28 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

Paul, the PowerBasic Code from Peter is understandable to you.
Thats what counts  ;D. PowerBasic connects cultures.

Paul Elliott

Well, I thought I understood it.

But as there are really only a couple main routines  it makes no sense for me to make changes that
Peter may be working on. So I'll stop. It just takes too long to figure out exactly what got changed
and how that impacts what I was working on.

It would be helpful to know what Peter's plan is. What is being changed to cover PB 10 and hopefully
PB CC v6. Why the extra empty tab? Or just stop posting until it is finished.

Peter Weis

Please do not stop with the program! But it is fun to program with you

I'm working on the function DoFormat

regards Peter

Peter Weis

of course with PBCC, it is clear
greetings Peter

Theo Gottwald


Paul möchte wissen was dein Plan ist, damit er sich entsprechend einklinken kann.

Ok, got a Message from Peter to Paul. It contains a real truth.
The heart of a real good "Pretty Printer" must really know any keyword of PB.

Peter writes:

QuoteHallo Theo,
Habe schon geschrieben,

Like said before ...

Quotedass ich an der Funktion DoFormat  arbeite! Das Ausarbeiten der Funktion gestaltet sich im Moment noch recht schwierig weil es viele Ausnahmen gibt die ich alle mit einbeziehen möchte!

I am still busy with the "DoFormat Function". It needs a bit more time because it needs to include a lot of exceptions.

QuoteIch arbeite schon drei Tage daran! Deswegen hört man so wenig von mir!
Kannst es Paul ausrichten!

This is ongoing for the last three days and may take more time. Please tell it to Paul.

Which i wanted to do hereby.

Peter will tell us when he's done with the "DoFormat".

Paul Elliott

did some work but my new code won't fit with what Peter's working on. so here's the exe as I've got
it now. the program is tab.exe dimply because this is the 1st program I've done with PB v10 using a
tab control without creating extra overlay windows/dialogs. it's all created right on the tab page.

and some of the change listing

' tab ddt version of code formatter
' 11/23/2011 v3 re-arrange GUI again
'               don't have format_cliked yet
' 11/24/2011    got format_clicked in place
'               fixed problem with text_ascoumn
' 11/25/2011    changing string concats to & instead of +
'               changing concat/add/sub if left var is 1st on right to &=/+=/-=
' 11/26/2011    fix for DIM x(1, 4)
'               handle multiple AS type on 1 line
'               indents variables -- still need fix if it can't fit in space *ERR
' 11/27/2011    eliminated *ERR
'               add ENUM to list of auto-indent
'               process THREAD FUNCTION like CALLBACK FUNCTION
'               indent continued lines tabsize
'              * still need to process continued variable declares

later: added progress bar & fixed problem of not saving main dialog handle.

much later: put new archive on my post dated 12/5/2011.

Theo Gottwald

Does it mean, that you have a final result, and peter will produce another program?
I believe we should bring things together after all because only this will allow further developement.
There are plans to enhance functionality of the Pretty Printer more far then where its now.
For example:
- extraction of strings
- local variables processing (removal of unsused?)

Paul Elliott


No, not a complete solution nor a competing program to Peter's.

Just have no idea exactly what Peter's complete plan of enhancements will be or
what changes he's currently making.

Not everybody will have Phoenix v2 to be able to rework the GUI or to easily understand
how the events are handled. I don't really have a problem as I've had Phoenix for years.

I was bored waiting so I did something.
I was just curious as to how easy it would be to do the same program in PB DDT ( which everyone
who wants to change/compile the source will have already ). For me it was very easy to go from
one to the other ( been doing that type of programming for many years ). Also it was easy for me
to make changes to the split variable section of code as I had coded it. As I explained earlier, I got
no feedback when I put the code out there. So I went ahead with my own program which did
nothing but split variables and have made changes that probably wouldn't fit easily into
CodeFormatter. It was bad enough with the way I originally coded it because it bypassed
the main part of the program ( which broke each line into individual elements and then put
them back together ). I figured that was why I got no feedback.

Some of the changes I've made are based on what I've coded for the call-tree/flowchart program
that I've been working on. That code is not ready for public viewing as I'm still getting the
call-tree/cross-reference part to handle most PB sources that I can find ( either on the PB forums
or my older programs ... still not that familiar with all the code for Classes ).

That's where things are as far as I'm concerned.

Theo Gottwald

Peter asks for the source code of what you have been doing so he can put it all together.
Can you make it available to him?

Paul Elliott

Not at this time.

I'm waiting to see what all Peter does. When will we see a final version?

Theo Gottwald

Peter, Paul schreibt, dass er derzeit noch nicht seinen Quellcode weitergeben will, sondern erst sehen will was du machst,
Wir warten also auf deinen Stand.

@Paul: I have translated this for Peter.

Peter Weis

I am still working on the function DoFormat! The thing assumes shape. Is at testing

greetings Peter

Paul Elliott

still bored so I reworked the variable indenting to better match rest of surrounding lines.

I'll see if I can remove the previously posted archive.

later: removed archive with executable. guess it wasn't wanted.

Theo Gottwald

Paul, can it be made into several Passes?
Then you get the full code into your pass, and its completely separate from what Peter is doing.

Peter kannst du das ding modular aufbauen dasses nacheinander in "Passes" arbeitet?
So könnte Paul parallel bestimmte dinge tun.

Paul Elliott


You've seen the code from v2.  What do you think?

It's obvious to me that you and Peter have been talking & planning but you have not shared
any details with the rest of the forum. Until that happens I don't plan on posting code.

I'm just testing things on my own and sharing the executable to see if anybody finds problems.
Still waiting to see what the plan is and what Peter has coded.