• Welcome to Jose's Read Only Forum 2023.

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.

Paul Elliott


I'm not sure I understood most of what you wrote.

Just because you move the Global variables to DoFormat does not mean that they are
reset each time it gets called. Consider what happens if you process 2 or more files in
1 run.

Yes, I saw you were passing fmtoption. But you need to also pass fmtcommon and should
reset it on entry to DoFormat. If you move your Global numeric variables into the fmtcommon
UDT then they can easily be reset.

I was under the impression from what you wrote that it was complete.
Why post code that doesn't work? It just seems to be a waste of time.

Peter Weis

Hi Paul,
The functions which require fmtcommon I will carry doformat piece by piece after so that I can no longer be transferred from the main program!
However, it takes some time! 'm Alone and I have to do other things!

Paul Elliott


If you move all the open/close/copy/etc of processed files into the DoFormat procedure then
there should be no need of fmtcommon in the main GUI program.

Take your time and test it this time around. I'll check back in a week or 2 ( or at most
by spring ).

Paul Elliott


Something as simple as the following will work to create the SLL.
Just need to add Common to the end of the Function DoFormat line.
And call the ProgressBar_Update routine in the main bas file.
And a couple small changes based on %AM_SLL to handle differences if needed.
Then you only need the 1 DoFormat.inc and you can use either the inc or sll.

' SLLDoFormat

#Dim All
#Register None
#Compile SLL "DoFormat.SLL"
#Option Version5
#Debug Error On

#Include Once "WIN32API.INC"
#Include Once "Code Formatter.inc"

%MAX_LINELEN                      = 400                    'maximum source code line length

Global   ztext()                        As String'source code line
Global   foDoFormat                  As fmtoptions
Global   fc                              As fmtcommon

%AM_SLL = 1

#Include "DoFormat.inc"

Paul Elliott

In case anyone is interested.

Just a minor re-working of Peter's code to produce a SLL for DoFormat.
I don't think I messed anything up. I just moved most of the Global & Static variables
into the fmtcommon UDT and moved the input/output file handling into the DoFormat
routine. Had to add a ProgressBar_Update routine in the main bas.

I'm using PB Win v10.03 & Jose's includes v3. Just compile SLLDoFormat.bas to produce the SLL.
In the main program Code Formatter.bas, you can have #Include DoFormat.inc or
#Link DoFormat.sll and it should work the same.

It is not the only way to do the job but it was quick. I'm sure that Peter will probably have
a better version. And I can hardly wait to see his v3.

No this is NOT a replacement for Peter's version. This is still HIS code.
I merely moved around a couple routines.
If this offends him ( or anyone ) then I'll remove it.

Theo Gottwald

Actually Peter is working on something else. Therefore looks like your version is now the last version, Paul.

Paul Elliott


Does this mean no v3? What exactly is/was going to be in v3?

His v2 still has some rough edges that need fixing but I was under the impression that all would be
fixed in v3.

Theo Gottwald

Peter has posted his last changes. Now the next contributor can take the code and change it and post it then.

Paul Elliott

What I last posted was Peter's code. I just moved a few routines around to allow for an SLL. The code
he supplied couldn't produce an SLL or DLL.

His last post clearly stated that he was still working on it AND on v3. but we might not see anything
until Spring. This last part I'm not too sure about. When is Spring in Germany?

Just curious.

Peter Weis

Hi Paul,
  You can get the latest version V3 of me if you like! I'll send them to you in email! I'm unfortunately not at the moment to do so. Must'm not even work even in retirement
regards Peter

Paul Elliott

Hi Peter,

Sorry to see you stop work on it, I really am.

But if you are not going to finish it then why not post all the code that you have and
let the next person work on it. I would like to look at your code at least to see the
direction you were going in.

That next person probably will not be me. I have a tough time figuring out another
programmer's variables and functions and logic when they are in English. I'm not
sure I could handle German ( let alone German abbreviations ). I'm not up to trying
to think in another language.  I'm still in awe of those who can think in more than
1 language.

Good luck.

Peter Weis

Hi Paul,
I will not stop but I do (make a break).
Because I do the new common project with wide Unicode files.
If you want, just carry the project on!
I have provided all of the code of V3.
regards Peter

(Translation changed Theo)

Paul Elliott


I question either your translation or what Peter wrote:
I have provided all of the code of V3.
regards Peter

(Translation changed Theo)

I can not see any v3 source posted anywhere.
I did send Peter a PM this morning but haven't heard back yet.
From what you posted on March 9th, I took it that Peter was completely done.

Peter Weis

Hi Paul,
take it easy, I w. This morning at work! Could you also post why do not I'll have to work up a little!
Please be patient :)

regards Peter

Paul Elliott


Sorry. I didn't know you were busy working.

I just got confused from what Theo said and then what you said and then what Theo translated
what you said.

I'll try to calm down. and I'm already drinking decaf tea.   ;D