Re: [fpc-pascal] ptop and comma.

2020-02-24 Thread fredvs via fpc-pascal
Hello Bart. OK, I did try your idea, changing the original code with this (see 2 last lines): procedure TPToP.Usage(ECode: word); begin writeLn('ptop : Usage : '); writeLn('ptop [-v] [-i indent] [-b bufsize ][-c optsfile][-l linesize] infile outfile'); writeLn(' converts infile to outfi

Re: [fpc-pascal] ptop and comma.

2020-02-24 Thread fredvs via fpc-pascal
>If you really dislike the memory leak (since it's not "nice >programming"), maybe you can set ExitCode before calling terminate? >(Untested idea (TM)) Hello Bart. Thanks for that constructive and respectful answer that gives solution. Indeed, I **really** dont like programs that generate memory

Re: [fpc-pascal] ptop and comma.

2020-02-24 Thread Bart via fpc-pascal
On Mon, Feb 24, 2020 at 10:11 AM Sven Barth via fpc-pascal wrote: > You are wrong. Halt() sets the error code provided as parameter. Terminate by > itself does not. > Terminate leads to the destructor being called while Halt exists the program > in a hard way. But as Tomas wrote, when a program

Re: [fpc-pascal] ptop and comma.

2020-02-24 Thread Sven Barth via fpc-pascal
fredvs via fpc-pascal schrieb am Mo., 24. Feb. 2020, 02:10: > Tomas Hajny-2 wrote > > The difference between your version and the original one is that the > > original finishes the program with some error code thus allowing some > > error checking in case the program was called from some script,

Re: [fpc-pascal] ptop and comma.

2020-02-23 Thread fredvs via fpc-pascal
Tomas Hajny-2 wrote > The difference between your version and the original one is that the > original finishes the program with some error code thus allowing some > error checking in case the program was called from some script, etc., > whereas your version finishes with a result of 0 even if th

Re: [fpc-pascal] ptop and comma.

2020-02-23 Thread fredvs via fpc-pascal
Hello Tomas and thanks for the infos. Hum, ok, so I give you the hand to find why the original code finishes the program with some memory leak. Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ ___ fpc-pasc

Re: [fpc-pascal] ptop and comma.

2020-02-23 Thread Tomas Hajny
On 2020-02-23 15:26, fredvs via fpc-pascal wrote: Hi, OK, I opted for changing in procedure Tjtop.Usage(ECode: word); halt(Ecode); //--> This produces a memory leak with terminate; // --> No nore memory leak. This makes no sense from my point of view. Halt finishes execution of

Re: [fpc-pascal] ptop and comma.

2020-02-23 Thread fredvs via fpc-pascal
Hello. OK, I opted for changing in procedure Tjtop.Usage(ECode: word); halt(Ecode); //--> This produces a memory leak with terminate; // --> No nore memory leak. There is a Github site forked from original ptop. It include ptop with extended comma feature. Also was added jtop, a

Re: [fpc-pascal] ptop and comma.

2020-02-23 Thread fredvs via fpc-pascal
Hello everybody and especially Michael. OK, I did find the very well hidden memory leak. In ptop.pp it comes from Procedure TPToP.DoRun, line 140 ---> Usage(1); And in the procedure Usage(), the last line produces the memory leak. Procedure TPToP.Usage(ECode : Word); begin Writeln ('ptop : U

Re: [fpc-pascal] ptop and comma.

2020-02-12 Thread fredvs via fpc-pascal
> Well, there have been changes in trunk. I obviously did a diff with the > trunk version, so probably that is the cause. Ha, nice, I will study this asap. Other thing, I did many search on internet to have the same as ptop: simple command line program-executable but for Java. Sadly this does no

Re: [fpc-pascal] ptop and comma.

2020-02-12 Thread Michael Van Canneyt
On Wed, 12 Feb 2020, fredvs via fpc-pascal wrote: The diff is quite big, and it's not whitespace changes... is that intentional, or if not, where did you get the original ptopu.pp It comes from source of fpc 3.0.4. Hum, so big? Well, there have been changes in trunk. I obviously did a dif

Re: [fpc-pascal] ptop and comma.

2020-02-12 Thread fredvs via fpc-pascal
Re-hello. In the previous zip file there is the ptopu.pp file (not ptop.pp that I did not touch). Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] ptop and comma.

2020-02-12 Thread fredvs via fpc-pascal
> The diff is quite big, and it's not whitespace changes... > is that intentional, or if not, where did you get the original ptopu.pp It comes from source of fpc 3.0.4. Hum, so big? To add a "comma" keyword, 1) Insert comma in keysymbol array. 2) Add "comma" in EntryNames. 3) Add option[t,comm

Re: [fpc-pascal] ptop and comma.

2020-02-12 Thread Michael Van Canneyt
On Wed, 12 Feb 2020, fredvs via fpc-pascal wrote: Hello Michael. I have added in ptopu.pp "comma" keyword and option[t,comma]^.selected := [spaft]; Works like charm. Included patched ptopu.pp ehm... This patch changes a lot more than just adding comma ? The diff is quite big, and it's n

Re: [fpc-pascal] ptop and comma.

2020-02-12 Thread fredvs via fpc-pascal
Hello Michael. I have added in ptopu.pp "comma" keyword and option[t,comma]^.selected := [spaft]; Works like charm. Included patched ptopu.pp ptopu.zip Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-gen

Re: [fpc-pascal] ptop and comma.

2020-02-11 Thread fredvs via fpc-pascal
> It should be relatively easily possible, because colon, period and so on are also treated specially. > if "," is recognized, a 'spaft' option will do what you want. Ha, ok, I will explore this. Thanks. Fre;D - Many thanks ;-) -- Sent from: http://free-pascal-general.1045716.n5.nabble.c

Re: [fpc-pascal] ptop and comma.

2020-02-11 Thread Michael Van Canneyt
On Tue, 11 Feb 2020, fredvs via fpc-pascal wrote: Hello everybody. I just discovered ptop. Well done Michael! I just ported and extended an old system. Thanks to ptop, I was able to make the code of uos.pas (+- 10.000 lines) more beautiful. Congratulation Michael, ptop can deal with the

[fpc-pascal] ptop and comma.

2020-02-11 Thread fredvs via fpc-pascal
Hello everybody. I just discovered ptop. Well done Michael! Thanks to ptop, I was able to make the code of uos.pas (+- 10.000 lines) more beautiful. Congratulation Michael, ptop can deal with the lot of {$IF DEFINED(something)} of my code. I was not able to do it with Jedi, who refused my code.