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

0 Members and 1 Guest are viewing this topic.

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #225 on: February 10, 2012, 09:57:45 PM »
Peter,

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.


Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #226 on: February 10, 2012, 11:17:03 PM »
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!
 

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #227 on: February 10, 2012, 11:41:03 PM »
Peter,

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 ).


Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #228 on: February 18, 2012, 03:17:32 PM »
Peter,

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.

Code: [Select]
' 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"
                           
« Last Edit: February 18, 2012, 03:45:35 PM by Paul Elliott »

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #229 on: February 18, 2012, 10:12:14 PM »
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.


Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1037
  • User-Rate: +30/-4
    • it-berater
Re: Code-Formatter PB 10
« Reply #230 on: March 09, 2012, 07:26:20 AM »
Actually Peter is working on something else. Therefore looks like your version is now the last version, Paul.

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #231 on: March 09, 2012, 01:01:37 PM »
Theo,

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.

 

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 1037
  • User-Rate: +30/-4
    • it-berater
Re: Code-Formatter PB 10
« Reply #232 on: March 09, 2012, 01:18:30 PM »
Peter has posted his last changes. Now the next contributor can take the code and change it and post it then.

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #233 on: March 09, 2012, 02:35:47 PM »
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.

 

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #234 on: March 09, 2012, 10:05:13 PM »
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

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #235 on: March 10, 2012, 12:11:00 AM »
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.


Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #236 on: March 10, 2012, 05:02:39 AM »
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)
« Last Edit: March 10, 2012, 01:40:04 PM by Theo Gottwald »

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #237 on: March 10, 2012, 04:43:22 PM »
Theo,

I question either your translation or what Peter wrote:
Quote
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.

 
 
« Last Edit: March 10, 2012, 04:46:18 PM by Paul Elliott »

Offline Peter Weis

  • Sr. Member
  • ****
  • Posts: 326
  • User-Rate: +15/-4
Re: Code-Formatter PB 10
« Reply #238 on: March 10, 2012, 07:42:26 PM »
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

Offline Paul Elliott

  • Full Member
  • ***
  • Posts: 164
  • User-Rate: +40/-32
Re: Code-Formatter PB 10
« Reply #239 on: March 10, 2012, 08:11:38 PM »
Peter,

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