Re: [fpc-pascal] CLI argument parsers (was: Resource compilation)

2019-01-13 Thread Michael Van Canneyt



On Mon, 14 Jan 2019, Martok wrote:


Am 13.01.2019 um 18:43 schrieb Michael Van Canneyt:

Assuming you mean the command-line arguments:

What's wrong/missing with the functionality in TCustomApplication ?

Other than that nobody in the wild seems to fully use it? ;-)


Your count is a little biased. A total of 41 examples/tools use it. 
14 utils distributed in the FPC tree use it.


home:~/fpc/packages> grep -i TCustomApplication */examples/*.* */tests/*.* 
../utils/*.* ../utils/*/*.* | wc -l
41
home:~/fpc/packages> grep -i TCustomApplication  ../utils/*.* ../utils/*/*.* | 
wc -l
14

There is a lazarus IDE wizard for a console application. 
Every Lazarus LCL application has it built-in. So it is used "in the wild".


The bare compiler tools do not use it because 
a) They predate TCustomApplication

b) It introduces a dependency on something which is not in the RTL but in 
packages.

So that it's not used is simply incorrect. It's more used than the posix-y 
getopts
unit which is also present in the fpc tree.

You simply didn't know about it, most probably.

You're welcome to suggest improvements, but as your rightly observed, 
we should not introduce another system.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC code to migrate Outlook PST file to MBOX format?

2019-01-13 Thread Ralf Quint

On 1/12/2019 4:26 AM, EsmeKael wrote:

Try this pst to mbox conversion tool for further information please visit :-
http://www.toolsbaer.com/pst-to-mbox-conversion/


Why is this repeated posting of advertising, that in no way answers the 
question of this thread, still allowed?


Ralf


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] CLI argument parsers (was: Resource compilation)

2019-01-13 Thread Martok
Am 13.01.2019 um 18:43 schrieb Michael Van Canneyt:
> Assuming you mean the command-line arguments:
> 
> What's wrong/missing with the functionality in TCustomApplication ?
Other than that nobody in the wild seems to fully use it? ;-)
Even most of the examples in the compiler tree use homegrown parsers, or look
like [1].

I'm a fan of getopts and use it (with a small wrapper) for almost everything (i.
[2]), but it seems that many people are not aware it even exists. It's even
POSIX compliant, so the program's users won't be surprised by some
implementation particulars.
But even that is nowhere near as elegant as argparse. I just don't like retyping
usage statements when they could be autogenerated ;-)
And Subparsers are, while possible, always quite hacky.

Of course, if someone was to implement something now, we'd be in the
https://xkcd.com/927/ situation...


[1] 
https://github.com/graemeg/freepascal/blob/master/utils/svn2cvs/svn2cvs.pp#L494
[2] https://github.com/martok/buildtools/blob/master/buildutil.lpr

-- 
Regards,
Martok

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Resource compilation

2019-01-13 Thread Michael Van Canneyt



On Sun, 13 Jan 2019, Martok wrote:



To a lesser degree: something like Python's argparse would be nice. Everyone
builds their own argument parser, usually with very different concepts and
varying amounts of code duplication.


Assuming you mean the command-line arguments:

What's wrong/missing with the functionality in TCustomApplication ?

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Resource compilation

2019-01-13 Thread Martok
Update time!



>  - UnicodeString Strings (L"foo")Done

>  - various forms of escape sequences for strings
Done

>  - Concatenated adjacent strings ("ABC" "DEF")
This is weird: windres, brcc and rc all do something different when
concatenating mixed Unicode and CP strings, as in `L"a" "b"`, `"a" L"b"`.
I have no idea what the correct action would be.

>  - complex resources: ACCELERATORS DIALOG/EX MENU/EX STRINGTABLE VERSIONINFO
Probably going to leave out the Dialog-Related stuff, since it's not super
relevant for us anyway. Windows users can just use RC ;-)

> It's also leaking memory like a rusty bucket, I have so far completely ignored
> what transfers object ownership in fcl-res classes. Heaptrc will hopefully 
> help
> here.
Fixed

All of windres's tests pass now, except for the Dialog related ones. I would
consider it more or less finished. Any more things to do? Otherwise, I'll stack
it into some patches.


A few lessons learned:
Using TStringList as a key-value-store (#define) is SLOW. Replacing it with a
TFPStringHashTable brought processing time for windows.h down from 4 seconds to
some 10ms. That's just insert operations.

Codepage Strings are weird if more than one CP is involved. There is almost no
way to carry a specific codepage anywhere: AnsiString[850] + Char =
AnsiString[CP_UTF8]... Also, ShortStrings are often converted to AnsiStrings, so
that doesn't reliably work either. Same for array of char. That made working
with plex awfully complicated, and I still think it's wrong in some cases. But
at least it works for most now.

Having a reentrant version of plex&pyacc would be nice. Flex and Bison can do it
these days.

To a lesser degree: something like Python's argparse would be nice. Everyone
builds their own argument parser, usually with very different concepts and
varying amounts of code duplication.


-- 
Regards,
Martok


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] FPC code to migrate Outlook PST file to MBOX format?

2019-01-13 Thread EsmeKael
Try this pst to mbox conversion tool for further information please visit :-
http://www.toolsbaer.com/pst-to-mbox-conversion/



--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal