[fpc-pascal] fpdoc project file

2015-12-06 Thread Mattias Gaertner
Hi, The 3.1.1 fpdoc -h help has some confusing items. Can someone explain them please: --project=fileUse file as project file --write-project=file Do not write documentation, create project file instead --write-project=file Write all command-line options

Re: [fpc-pascal] Unicode file names

2015-12-05 Thread Mattias Gaertner
On Sat, 5 Dec 2015 12:55:42 +0100 (CET) Michael Van Canneyt <mich...@freepascal.org> wrote: > > > On Sat, 5 Dec 2015, Mattias Gaertner wrote: > > > Hi, > > > > fpcres fails on Windows with paths containing non ASCII characters. The > > compile

Re: [fpc-pascal] Unicode file names

2015-12-05 Thread Mattias Gaertner
On Sat, 5 Dec 2015 13:44:08 +0100 Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > On 05/12/15 13:36, Mattias Gaertner wrote: > > On Sat, 5 Dec 2015 12:55:42 +0100 (CET) > > Michael Van Canneyt <mich...@freepascal.org> wrote: > > > >> On Sat, 5 Dec 2015,

[fpc-pascal] Unicode file names

2015-12-04 Thread Mattias Gaertner
Hi, fpcres fails on Windows with paths containing non ASCII characters. The compiler itself happily compiles units. FPC 3.0.0 and 3.1.1. Is that a regression? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?

2015-12-07 Thread Mattias Gaertner
On Mon, 07 Dec 2015 21:52:35 +0100 Bo Berglund wrote: > On Mon, 7 Dec 2015 20:27:12 +0100 (CET), Michael Van Canneyt > wrote: >[...] > 1) Went to http://www.freepascal.org/down/i386/linux-hungary.var > > 2) Downloaded the "everything" file >

Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?

2015-12-07 Thread Mattias Gaertner
On Mon, 07 Dec 2015 23:15:50 +0100 Bo Berglund <bo.bergl...@gmail.com> wrote: > On Mon, 7 Dec 2015 22:16:26 +0100, Mattias Gaertner > <nc-gaert...@netcologne.de> wrote: > > >> Now I have to deal with Lazarus, but that is another list/forum... > > > >

Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?

2015-12-07 Thread Mattias Gaertner
On Mon, 07 Dec 2015 23:36:17 +0100 Jonas Maebe wrote: > Michael Van Canneyt wrote: > > I believe fpc 3.0 is in debian experimental, but it would be a very bad > > idea to use that in linux mint. > > If you limit yourself to just using FPC from Debian experimental, I

Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?

2015-12-07 Thread Mattias Gaertner
On Mon, 07 Dec 2015 23:47:36 +0100 Bo Berglund wrote: >[...] > >I have not tried on Linux-Mint. > >Can you test? > > I did as follows: > sudo apt-get install libgtk2.0-dev > > It pulled no less than 73 different packages Debian is great at splitting packages into

Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?

2015-12-07 Thread Mattias Gaertner
On Mon, 07 Dec 2015 23:56:56 +0100 Bo Berglund wrote: >[...] > Target OS: Linux for i386 > Compiling lazres.pp > Linking ./lazres > Warning: "crti.o" not found, this will probably cause a linking > failure > Warning: "crtn.o" not found, this will probably cause a linking >

Re: [fpc-pascal] Can fpc 3.0 release be installed using apt-get on Linux Mint?

2015-12-07 Thread Mattias Gaertner
On Tue, 8 Dec 2015 00:21:28 +0100 Mattias Gaertner <nc-gaert...@netcologne.de> wrote: > On Mon, 07 Dec 2015 23:56:56 +0100 > Bo Berglund <bo.bergl...@gmail.com> wrote: > > >[...] > > Target OS: Linux for i386 > > Compiling lazres.pp > > Lin

Re: [fpc-pascal] set code page

2015-12-17 Thread Mattias Gaertner
On Thu, 17 Dec 2015 13:36:17 +0100 Dariusz Mazur wrote: > Hi >is there possible to set codepage {$codepage xxx} to cp_none Do you mean CP_ACP? > for example one source file have {$codepage 1250} but rest i need > default (without any setting) Mattias

Re: [fpc-pascal] Linker error

2015-12-18 Thread Mattias Gaertner
On Fri, 18 Dec 2015 11:30:00 +0100 Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > > Mattias Gaertner wrote on Fri, 18 Dec 2015: > > > What could be the cause of this linker error: > > > > main.pp(6923,23) Warnung: Symbol "CommandLine" ist veralte

[fpc-pascal] Linker error

2015-12-17 Thread Mattias Gaertner
Hi, What could be the cause of this linker error: main.pp(6923,23) Warnung: Symbol "CommandLine" ist veraltet /usr/bin/ld.bfd: warning: ../link.res contains output sections; did you forget -T? /usr/bin/ld.bfd: /usr/lib/fpc/3.0.0/units/x86_64-linux/rtl/cprt0.o: unrecognized relocation (0x2a) in

Re: [fpc-pascal] FPC Unicode / CodePage aware strings

2015-12-10 Thread Mattias Gaertner
On Thu, 10 Dec 2015 12:17:28 +0100 Jonas Maebe wrote: >[...] > > Try {$codepage utf8}. > > That won't change anything, because {$mode delphiunicode} implies "use > the default system code page to interpret the source code", and that's > UTF-8 on his system. Does

Re: [fpc-pascal] FPC Unicode / CodePage aware strings

2015-12-10 Thread Mattias Gaertner
On Thu, 10 Dec 2015 12:02:31 + Graeme Geldenhuys wrote: > On 2015-12-10 11:16, Jonas Maebe wrote: > > There is no such thing as "official FPC Unicode". We added support for > > codepage-aware ansistrings. We added unicodestring overloads for a > > Does the

[fpc-pascal] buggy debian package

2015-12-17 Thread Mattias Gaertner
Hi, Debian has a FPC 3.0.0 package called "rc-buggy". https://packages.debian.org/search?keywords=fpc=names=all=all Is it just me, or does "buggy" sound a bit below awesome? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Implementing Factory Method with Pascal

2015-11-27 Thread Mattias Gaertner
One solution: var animal: TDog; BEGIN animal := TAnimalFactory.create(atDog) as TDog; try animal.bark; finally animal.free; end; END. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] fppkg compiler upgrade

2015-11-23 Thread Mattias Gaertner
On Sun, 22 Nov 2015 20:55:14 -0700 (MST) leledumbo wrote: > > What is the proper way of upgrading fppkg? > > $ rm ~/.fppkg/config/default > > now rerun fppkg, it should create a new config. if it still shows 2.6.4, > that means your 3.1.1 is inaccessible or has

[fpc-pascal] fppkg compiler upgrade

2015-11-22 Thread Mattias Gaertner
Hi, I have fpc 2.6.4 on Linux and "fppkg list" shows the 2.6.4 packages. Then I install fpc 3.1.1 using "make install". fppkg still shows the 2.6.4 packages. What is the proper way of upgrading fppkg? The wiki page does not tell me: http://wiki.lazarus.freepascal.org/fppkg Mattias

Re: [fpc-pascal] FPC 3.x for Windows and code page conversion

2015-11-23 Thread Mattias Gaertner
On Mon, 23 Nov 2015 16:43:18 +0100 Lubos Pintes wrote: > Hello, > I am developing a console application which receives an UTF-8 encoded > text through stdin. > The text is, after possible modification, sent to SAPI5. The SAPI5 > generated interface wrappers have

Re: [fpc-pascal] Conditional code for FPC modes

2016-06-15 Thread Mattias Gaertner
On Wed, 15 Jun 2016 11:18:38 +0200 Sven Barth wrote: > Am 15.06.2016 10:15 schrieb "Juha Manninen" : > > > > Are there defines matching the modes in FPC, for example {$mode > delphiunicode} ? > > I want to do something like : > > {$IFDEF

Re: [fpc-pascal] Conditional code for FPC modes

2016-06-15 Thread Mattias Gaertner
On Wed, 15 Jun 2016 11:43:59 +0200 Mattias Gaertner <nc-gaert...@netcologne.de> wrote: >[...] > Thanks for the hint. Done. Oops. Wrong thread. To my rescue a hint: You can see the actual FPC defines in Lazarus by placing the cursor in the directive and pressing Ctrl+Space: {$IF

Re: [fpc-pascal] Questions regarding FPImage's TFPMemoryImage.FData variable

2016-06-01 Thread Mattias Gaertner
On Thu, 26 May 2016 11:24:44 +0100 Graeme Geldenhuys wrote: >[...] > 3) The FData image buffer (assuming (1) is correct) uses Integer instead >of Byte as it's element size. So I'm assuming a singe Integer hold >all the colour information for a single pixel?

Re: [fpc-pascal] Single threaded application on multicore CPU

2016-06-22 Thread Mattias Gaertner
On Wed, 22 Jun 2016 07:41:04 -0400 Stephen Chrzanowski wrote: > Everything has a cost. But swapping CPU threads isn't as costly as a fried > CPU. Keeping the CPU cool at all costs is better than having a hotspot on > the die which COULD damage the heat sink. On my Linux

Re: [fpc-pascal] Single threaded application on multicore CPU

2016-06-22 Thread Mattias Gaertner
On Wed, 22 Jun 2016 13:36:08 +0100 Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote: > On 2016-06-22 13:14, Mattias Gaertner wrote: > > On my Linux it does not swap the CPU and I can't find any hard data that > > Windows is swapping because of hotspot problems,

Re: [fpc-pascal] How to find the return type of a for..in ?

2016-06-16 Thread Mattias Gaertner
On Thu, 16 Jun 2016 14:59:47 +0100 Graeme Geldenhuys wrote: >[...] > Here is another stumbling block of for.in usage. The statement itself > doesn't give you any hint as to what the return type is. What is the > correct way of finding the return type of a for..in

[fpc-pascal] location modifier

2016-01-18 Thread Mattias Gaertner
Hi, I can't find the 'location' modifier in the docs. Is it missing? For example: function bsd_socket(Domain: LongInt location 'd0'; Type_: LongInt location 'd1'; Protocol: LongInt location 'd2'): LongInt; syscall SocketBase 30; See for example packages/rtl-extra/src/amiga/sockets.pp Mattias

Re: [fpc-pascal] location modifier

2016-01-18 Thread Mattias Gaertner
On Mon, 18 Jan 2016 16:40:17 +0100 (CET) Michael Van Canneyt <mich...@freepascal.org> wrote: > > > On Mon, 18 Jan 2016, Mattias Gaertner wrote: > > > Hi, > > > > I can't find the 'location' modifier in the docs. Is it missing? > > I didn't even know

Re: [fpc-pascal] Please someone explain this to me

2016-02-10 Thread Mattias Gaertner
> Sven Barth hat am 10. Februar 2016 um 15:09 > geschrieben: > [...] > > The {%...} directive is a comment in other contexts and can be used safely. > > What about include files included by other include files? That is no problem for the MainUnit directive. The

Re: [fpc-pascal] Please someone explain this to me

2016-02-11 Thread Mattias Gaertner
> Michael Van Canneyt hat am 11. Februar 2016 um 04:27 > geschrieben: >[...] > Lazarus IDE shows a tooltip when you hover over an identifier with the mouse. > I suspect it will take one on the team less than 10-minutes to add the unit > name to the tooltip, in addition to

Re: [fpc-pascal] Pascal Lexical Diagrams

2016-01-30 Thread Mattias Gaertner
On Sat, 30 Jan 2016 04:45:27 -0500 Anthony Walter wrote: > I've been working on writing Javascript to generate lexical language > diagrams for the getlazarus.org learning center portal. > > With my script I'm able to render these diagrams which will be appear under > the Free

[fpc-pascal] Lazarus Release 1.6

2016-02-18 Thread Mattias Gaertner
The Lazarus team is glad to announce the release of Lazarus 1.6. This release was built with FPC 3.0.0. The previous release Lazarus 1.4.4 was built with FPC 2.6.4. Here is the list of changes for Lazarus and Free Pascal: http://wiki.lazarus.freepascal.org/Lazarus_1.6.0_release_notes

Re: [fpc-pascal] Happy tickets benchmark

2016-02-14 Thread Mattias Gaertner
On Sun, 14 Feb 2016 10:11:54 +0100 Florian Klaempfl wrote: >[...] > For the record: with a few changes in the compiler I could reduce the > execution time of the example significantly . But I won't commit it > probably (maybe parts of it): extensive loop unrolling and

Re: [fpc-pascal] Happy tickets benchmark

2016-02-14 Thread Mattias Gaertner
On Sun, 14 Feb 2016 10:35:22 +0100 Florian Klaempfl wrote: >[...] > Do you think people will bother? Nobody mentioned to the original poster > so far: > - that the used FPC is outdated > - that only -O2 is used instead of -O3 (or -O4 with 3.0.0) > - that even FPC 2.6.4

Re: [fpc-pascal] buggy debian package

2016-02-01 Thread Mattias Gaertner
On Mon, 01 Feb 2016 13:30:51 +0100 Jonas Maebe wrote: >[...] > FWIW, last weekend FPC 3.0 was promoted from Debian Experimental to > Debian Unstable. Awesome :) Mattias ___ fpc-pascal maillist -

Re: [fpc-pascal] Default source encoding

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 13:52:54 +0200 Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > On 31/03/16 13:46, Mattias Gaertner wrote: > > > According to > > http://wiki.freepascal.org/index.php?title=FPC_Unicode_support#String_constants > > > > "the constant st

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversionx

2016-04-06 Thread Mattias Gaertner
On Wed, 06 Apr 2016 15:05:02 +0200 tobiasgie...@gmail.com wrote: > Hello, > > Jonas wrote: > > If you get ASCII, it means that one of the LC_ALL, LC_CTYPE and/or LANG > > environment variables is set to > > a setting that corresponds to ASCII (such as "C"), or set to a value that > > is not

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversion

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 10:32:58 +0200 (CEST) Michael Van Canneyt wrote: >[...] > You cannot, but you can set DefaultSystemCodePage to CP_UTF8. I think it is important to note how to do this properly: SetMultiByteConversionCodePage(CP_UTF8);

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 13:27:05 +0300 Juha Manninen wrote: >[...] > But yes, it requires Lazarus IDE because LazUtils is a Lazarus > package. At least you must create and compile the project using > Lazarus IDE. Or simply copy the two units FPCAdds, LazUTF-8 or parts of

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-04 Thread Mattias Gaertner
On Mon, 04 Apr 2016 10:18:18 +0200 tobiasgie...@gmail.com wrote: > Hello, > > disallowing "AnsiString" code for UTF-8 is a huge regression. > > I use TStringList for UTF-8 strings. This is no longer possible, because > automatic conversions cause question marks and data loss. Lazarus uses

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversionx

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 11:34:18 +0100 Graeme Geldenhuys wrote: > On 2016-04-04 11:23, tobiasgie...@gmail.com wrote: > > On Mac, not even cwstring does that. It sets the DefaultSystemCodePage > > to 20127. > > I just installed FPC 3.0 on my Macbook Pro (bought in the

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 10:52:20 +0100 Graeme Geldenhuys wrote: > On 2016-04-04 10:27, Juha Manninen wrote: > > Just use the new UTF-8 mode provided by Lazarus and remove all > > explicit conversion functions. > > This is the FPC mailing list. Not everybody here uses

Re: [fpc-pascal] FPC 3: disabling automatic AnsiString codepage conversion

2016-04-04 Thread Mattias Gaertner
On Mon, 4 Apr 2016 11:35:53 +0200 (CEST) Michael Van Canneyt wrote: >[...] > >> Then no conversions will be done for all ansistrings that contain UTF8. > > > > And this really means AnsiString, not AnsiString(something). > > The latter cannot contain UTF8 unless you do

Re: [fpc-pascal] IsValidIdent() with dots

2016-03-23 Thread Mattias Gaertner
On Wed, 23 Mar 2016 10:28:15 +0200 Juha Manninen wrote: > Hi > > Is there a function like IsValidIdent but accepting also dots (.), > as in name "TForm1.Action1Execute"? FPC 3.1.1 has function IsValidIdent(const Ident: string; AllowDots: Boolean = False;

Re: [fpc-pascal] Default source encoding

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 14:14:14 +0200 (CEST) Michael Van Canneyt wrote: >[...] > > What happens on a Russian system cp1251 with a cp1251 AnsiString > > literal? > > > > writeln('Привет'); > > Careful, writing may change the codepage. Yes, I know. That's why it is important

Re: [fpc-pascal] Default source encoding

2016-03-31 Thread Mattias Gaertner
On Thu, 31 Mar 2016 14:38:35 +0200 Jonas Maebe wrote: >[...] > There are two separate things: > a) the code page that the compiler uses *if* it has to convert a string > at compile time to a different code page (e.g. because you assign the > string constant to an

Re: [fpc-pascal] Inline methods

2016-05-19 Thread Mattias Gaertner
On Thu, 19 May 2016 08:49:04 +0200 LacaK wrote: > > >> Hm, I have checked in Lazarus on Project Options / Verbosity appropriate > >> -vd option, but in output window I do not see any more info ... > >> How should look such info message ? > > Did you build your project clean? >

Re: [fpc-pascal] Inline methods

2016-05-18 Thread Mattias Gaertner
On Wed, 18 May 2016 14:43:06 +0200 LacaK wrote: > > > > >> Any other ideas, what leads compiler to not inline ? > > > > If you compile with -vd, the compiler will tell you in most cases why > > it's not inlining. > Hm, I have checked in Lazarus on Project Options / Verbosity

Re: [fpc-pascal] code example where AnsiString used in FCL (SqlDB) causes data loss

2016-05-11 Thread Mattias Gaertner
On Wed, 11 May 2016 22:33:13 +0200 Jonas Maebe wrote: > Graeme Geldenhuys wrote: > > On 2016-05-11 18:58, Michael Van Canneyt wrote: > >> > For 99,99% of cases, no changes to your code are required. > >> > If it worked in 2.6.4, it will work in 3.0.0 > > > > Just

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-16 Thread Mattias Gaertner
On Fri, 15 Apr 2016 10:43:55 +0200 Michael Schnell wrote: >[...] > Do you suggest that the codepage of the sourcecode is preserved by the > compiler when creating the string constant in object code ? It depends. There are two codepages. The real one and the one you tell

Re: [fpc-pascal] FPC 3 regression: cannot use TStringList for UTF-8 data any more?

2016-04-16 Thread Mattias Gaertner
On Fri, 15 Apr 2016 10:19:06 +0200 Michael Schnell wrote: > On 04/15/2016 08:35 AM, Michael Van Canneyt wrote: > > > > For string constants there are slightly different rules. There the > > result depends on the {$codepage} directive of the source file. > > Hmmm. > > If

Re: [fpc-pascal] Weird string behavior

2016-07-25 Thread Mattias Gaertner
On Mon, 25 Jul 2016 23:23:23 +0200 Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > On 25/07/16 23:07, Mattias Gaertner wrote: > > DefaultSystemCodePage = 1252 > > s3 = "abcdef" cp = 65001 > > Thanks. So the rule for concatenation appears to be: &g

Re: [fpc-pascal] Test for valid ip address

2016-07-28 Thread Mattias Gaertner
On Thu, 28 Jul 2016 10:26:32 +0200 Jonas Maebe wrote: > On 28/07/16 10:14, Koenraad Lelong wrote: > > I need a way to test if an string containing an ipv4-address is really > > an ipv4-address. > > I tried > > tmpAddress:=HostAddrToStr(StrToHostAddr(IPAddressStr)); > >

Re: [fpc-pascal] Weird string behavior

2016-07-23 Thread Mattias Gaertner
On Sat, 23 Jul 2016 00:29:32 +0200 Bart wrote: > On 7/22/16, Jonas Maebe wrote: > > >> ResultA := AnsiToUTF8(AnsiStrA + AnsiStrA); // UTF-8 ResultB := > >> AnsiToUTF8(AnsiStrA) + AnsiToUTF8(AnsiStrA); // Win-1252 > >> > >> > >> And resultA

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Mattias Gaertner
On Tue, 26 Jul 2016 12:03:21 +0200 Jonas Maebe <jonas.ma...@elis.ugent.be> wrote: > Mattias Gaertner wrote on Tue, 26 Jul 2016: > > > It seems the Delphi rules for non rawbytestrings are: > > - Concatenate two same declared strings: append bytes, copy dyn. cp > >

Re: [fpc-pascal] Weird string behavior

2016-07-26 Thread Mattias Gaertner
On Tue, 26 Jul 2016 11:01:28 +0200 Jonas Maebe wrote: >[...] > Could you try the same program with u1 as plain ansistring instead of > utf8string? (with an additional > "setcodepage(rawbytestring(u1),65001,false);" after assigning u1) Sure: {$APPTYPE CONSOLE}

Re: [fpc-pascal] Weird string behavior

2016-07-25 Thread Mattias Gaertner
On Mon, 25 Jul 2016 22:25:59 +0200 Jonas Maebe wrote: > On 23/07/16 13:31, Petr Kohut wrote: > > Hello, > > here are results: > > Thanks a lot. Could you test one more? I think I will have all > information I need then. > > > Jonas > > {$APPTYPE CONSOLE} > >

Re: [fpc-pascal] what is the correct way to write {$IFDEF FPC Version > 3.0}

2016-07-08 Thread Mattias Gaertner
On Fri, 8 Jul 2016 18:47:19 +0800 Dennis wrote: > what is the correct way to write {$IFDEF FPC Version > 3.0} {$IF FPC_FULLVERSION>3} Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] Initialization of packed record local variables?

2016-07-22 Thread Mattias Gaertner
On Fri, 22 Jul 2016 11:03:23 +0200 (CEST) Michael Van Canneyt wrote: > On Fri, 22 Jul 2016, leledumbo wrote: > > >> OK, I did not know about the default keyword. > >> > >> Is "default" zero? > > > >

Re: [fpc-pascal] What is the difference between TThread.Queue(aMethod: TThreadMethod) and Application.QueueAsyncCall(AMethod: TDataEvent; Data: PtrInt);

2016-07-01 Thread Mattias Gaertner
On Fri, 1 Jul 2016 17:47:58 +0200 (CEST) Michael Van Canneyt wrote: >[...] > Application.QueueAsyncCall has nothing to do with threads. > This is an LCL method which can be used to insert a callback in the message > loop. > I think it unlikely that this is thread-safe,

Re: [fpc-pascal] for loop vs while loop

2017-02-01 Thread Mattias Gaertner
On Wed, 1 Feb 2017 11:49:34 + Graeme Geldenhuys wrote: > Hi, > > Just curious (been in a discussion with somebody else). Is there a > performance difference between a FOR loop and a WHILE loop? Yes, for-loop calculates the end value only once. > Not sure

Re: [fpc-pascal] How to use pipes ?

2017-02-01 Thread Mattias Gaertner
On Wed, 1 Feb 2017 05:02:05 -0700 (MST) fredvs wrote: > Hello. > > I have done lot of search on internet about pipes without success. > Even for Delphi. no demo nor explanation. > The same in fpc wki page. > > For example, how to use bytesavailable with pipes ?

Re: [fpc-pascal] class property accessor static

2017-02-07 Thread Mattias Gaertner
On Tue, 7 Feb 2017 13:25:16 +0100 Maciej Izak <hnb.c...@gmail.com> wrote: > 2017-02-07 13:11 GMT+01:00 Mattias Gaertner <nc-gaert...@netcologne.de>: >[...] > > Sorry, I don't get it. > > Why is using a static method as accessor an advantage? > > > >

[fpc-pascal] class property accessor static

2017-02-07 Thread Mattias Gaertner
Hi, The getter/setter of a class-property must be "static" (Delphi compatible). If I understand "static" correctly, then "static" simply omits passing the class as parameter. So a static class procedure is just a dumber version of a normal class procedure. What is the advantage of using "static"

Re: [fpc-pascal] class property accessor static

2017-02-07 Thread Mattias Gaertner
On Tue, 7 Feb 2017 12:30:26 +0100 Maciej Izak <hnb.c...@gmail.com> wrote: > 2017-02-07 12:10 GMT+01:00 Mattias Gaertner <nc-gaert...@netcologne.de>: >[...] > Generally "static" means no hidden parameter "self". "static" for methods > is use

Re: [fpc-pascal] class property accessor static

2017-02-07 Thread Mattias Gaertner
On Tue, 7 Feb 2017 13:31:10 + Graeme Geldenhuys wrote: >[...] > Couldn't that simply be > > Writeln(TFoo.F); Yes. > I never understood Object Pascal's class methods/properties either? > Unlike Java, not everything needs to be in a class. We are

Re: [fpc-pascal] class property accessor static

2017-02-07 Thread Mattias Gaertner
On Tue, 7 Feb 2017 19:23:52 +0100 Sven Barth wrote: >[...] > Oh and don't forget that non-static class methods can be virtual (sometimes > I really miss that in C++). In FPC static class methods can be virtual as well. Mattias

Re: [fpc-pascal] class property accessor static

2017-02-07 Thread Mattias Gaertner
On Tue, 7 Feb 2017 23:20:18 +0100 Sven Barth <pascaldra...@googlemail.com> wrote: > Am 07.02.2017 19:59 schrieb "Maciej Izak" <hnb.c...@gmail.com>: > > > > > > 2017-02-07 19:49 GMT+01:00 Mattias Gaertner <nc-gaert...@netcologne.de>: > >&g

Re: [fpc-pascal] IsValidIdent() and identifiers escaped with

2017-02-05 Thread Mattias Gaertner
On Sun, 5 Feb 2017 14:24:46 + Howard Page-Clark wrote: > Consider this program, which returns False: > > program Project1; > > uses sysutils; > > var >: boolean; > > begin >:=IsValidIdent(''); >WriteLn('IsValidIdent() evaluates to ', ); > end. > >

[fpc-pascal] destructor

2017-01-24 Thread Mattias Gaertner
Hi, fpc allows to declare a method with the destructor keyword, that is not a real destructor, because it does not free the memory. For what is this feature good for? For example: Type TClassA = class public destructor Foo; end; destructor TClassA.Foo; begin end; var o: TClass; begin

[fpc-pascal] Typecast class-of to class

2017-02-18 Thread Mattias Gaertner
Hi, FPC allows to type cast a class-of variable to a class instance. Is this a bug or a feature? var c: TClass; begin TObject(c).ClassName; // crash end. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Mattias Gaertner
On Sun, 12 Feb 2017 15:33:23 +0800 Tim Veldhuizen wrote: > Indeed, I can confirm Delphi does this. I think since 2009 or XE or so, > but AFAIK it doesn't need to. It does it only for the files that are > explicitly added to the project, but those are also in the dproj

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Mattias Gaertner
On Mon, 13 Feb 2017 16:47:38 -0700 (MST) fredvs wrote: >[...] > This works (Mathias way): That's not my way. In my opinion you should not put paths into Pascal sources and the directive should be disabled in units. >[...] > Congratulation Mathias, you come late, but you

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-12 Thread Mattias Gaertner
On Sun, 12 Feb 2017 16:17:01 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: >[...] > > One example might be when you are writing a quick program and don't want > > to send in a whole bunch of -Fu options and go into dialog boxes in > > lazarus configuring it, so you just quickly write

Re: [fpc-pascal] uses myunit in '../src/myunit.pas' ?

2017-02-13 Thread Mattias Gaertner
On Mon, 13 Feb 2017 09:34:09 -0700 (MST) fredvs wrote: > > The compiler already does this. > Yes, that I know, for one unit, but try this: I guess you are searching for {$unitpath Documents} The problem with this directive is that it only works correct in the program. FPC

Re: [fpc-pascal] destructor

2017-01-24 Thread Mattias Gaertner
On Tue, 24 Jan 2017 15:33:30 +0100 Maciej Izak <hnb.c...@gmail.com> wrote: > 2017-01-24 12:48 GMT+01:00 Mattias Gaertner <nc-gaert...@netcologne.de>: > > > fpc allows to declare a method with the destructor keyword, that is > > not a real destructor, because it does

Re: [fpc-pascal] FPC run (run program after compile)

2017-01-16 Thread Mattias Gaertner
On Mon, 16 Jan 2017 00:06:59 -0700 "Lars" wrote: > Is there a way to compile a program with fpc at the command line and run > it right after? > > Something like > fpc run project1.pas -Fu../ instantfpc -Fu../ project1.pas > The only thing I could find was InstantFpc,

Re: [fpc-pascal] FPC run (run program after compile)

2017-01-16 Thread Mattias Gaertner
On Mon, 16 Jan 2017 05:22:14 -0700 "Lars" wrote: >[...] > That instantfpc has catch22 like you cant compule multiple projects with > the same name, i.e. it caches file name only (caveat) whereas fpcrun would > compile it in current directory, as normal, no special cache dir

Re: [fpc-pascal] FPC run (run program after compile)

2017-01-16 Thread Mattias Gaertner
On Mon, 16 Jan 2017 13:15:40 -0700 "Lars" wrote: >[...] > Does instantfpc make it mandatory that you put this at the top of every > source file: > > #!/usr/local/bin/fpc.d/3.0.0/instantfpc --set-cache=./ No. That's only needed if you want to run the Pascal file directly:

Re: [fpc-pascal] with no if assigned() there are bugs

2016-09-22 Thread Mattias Gaertner
On Wed, 21 Sep 2016 22:43:57 -0600 "Lars" wrote: > On Wed, September 21, 2016 6:27 am, Pierre Free Pascal wrote: > > There is also the -gc option: > > -gcGenerate checks for pointers > > > > > > This is another debugging option, that is not used very often, > > > I

Re: [fpc-pascal] Does FCL Image support transparency?

2016-09-16 Thread Mattias Gaertner
On Fri, 16 Sep 2016 17:48:33 +0200 (CEST) Michael Van Canneyt wrote: > On Fri, 16 Sep 2016, Reimar Grabowski wrote: > > > Hi, > > > > I want to put watermarks on images in a command line application. > > This doesn't do the trick: > > > >

Re: [fpc-pascal] FreeBSD distro with fpc as star.

2016-11-09 Thread Mattias Gaertner
On Wed, 9 Nov 2016 09:39:40 + Graeme Geldenhuys wrote: > On 2016-11-08 11:04, Michael Schnell wrote: > > Sadly in my compiled "trunk" version 1.7 on Linux the <"LCLWidgetType"> > > drop down menu is not shown any more :-(. > > The redesign of Lazarus's

Re: [fpc-pascal] Underscores in numerical literals - grouping

2016-11-22 Thread Mattias Gaertner
On Tue, 22 Nov 2016 13:32:03 + Graeme Geldenhuys wrote: > On 2016-11-22 13:26, Sven Barth wrote: > > I think the difference a tab versus a couple of spaces makes (even if > > across a whole file or a whole project) will be insignificant > > Well, for every

[fpc-pascal] Lazarus Release 1.6.2

2016-11-15 Thread Mattias Gaertner
The Lazarus team is glad to announce the release of Lazarus 1.6.2. This is a bugfix release. This release was built with FPC 3.0.0. The previous release Lazarus 1.6 was built with FPC 3.0.0 too. Here is the list of fixes for Lazarus 1.6.x: http://wiki.freepascal.org/Lazarus_1.6_fixes_branch

Re: [fpc-pascal] Docs: Type A = Integer?

2016-11-13 Thread Mattias Gaertner
On Sun, 13 Nov 2016 21:21:16 +0100 Ewald wrote: > Hello, > > Section 1.2.40 of Programmers guide > (http://www.freepascal.org/docs-html/prog/progsu40.html#x47-460001.2.40) > says, somewhere in the middle: > > Type > A = Integer; > > Is it supposed to be there? If

Re: [fpc-pascal] MySQL 5.7 and FreePascal

2016-11-19 Thread Mattias Gaertner
On Sun, 20 Nov 2016 00:33:23 +0100 (CET) Michael Van Canneyt wrote: >[...] > It depends. MySQL 5.7 is supported in the mysql57dyn.pp unit, but I am not > sure it is included in Lazarus 1.6. It is shipped with fpc 3.0.0, so yes. Mattias

Re: [fpc-pascal] Missing messages

2016-11-03 Thread Mattias Gaertner
>[...]Then there is also the issue of them not conforming > to Unicode standards eg: the Lazarus Forum. What do you mean? Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

[fpc-pascal] server down?

2016-10-17 Thread Mattias Gaertner
Hi, On the bug tracker login page http://mantis.freepascal.org/login_page.php?return=%2Fmy_view_page.php%3F I see this text: Do you already have a login at Free Pascal Community? You can use that login here (use your e-mail address as username). When clicking on the "Free Pascal Community"

Re: [fpc-pascal] FPImage and mult-page TIFF support

2016-12-07 Thread Mattias Gaertner
On Wed, 7 Dec 2016 15:34:13 + Graeme Geldenhuys wrote: >[...] > fs := TFileStream.Create('/tmp/multipage_tiff_example.tif', fmOpenRead); > t := TFPReaderTiff.Create; t.OnCreateImage:=@... > t.LoadFromStream(fs, true); Mattias

Re: [fpc-pascal] FPImage and mult-page TIFF support

2016-12-08 Thread Mattias Gaertner
On Thu, 8 Dec 2016 12:12:27 + Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote: > On 2016-12-07 17:47, Mattias Gaertner wrote: > >> > t := TFPReaderTiff.Create; > > t.OnCreateImage:=@... > > > > Thanks that solved it. > > But why ca

Re: [fpc-pascal] FPImage and mult-page TIFF support

2016-12-08 Thread Mattias Gaertner
On Thu, 8 Dec 2016 14:09:53 + Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote: > On 2016-12-08 14:01, Mattias Gaertner wrote: > > That would be a 64bit per pixel image, wasting a lot of memory. > > Why FPImage uses 64bit per pixel is beyond me! The origina

Re: [fpc-pascal] FPImage and mult-page TIFF support

2016-12-08 Thread Mattias Gaertner
On Thu, 8 Dec 2016 15:15:55 + Graeme Geldenhuys <mailingli...@geldenhuys.co.uk> wrote: > On 2016-12-08 14:22, Mattias Gaertner wrote: >[...] > It's not rocket science. ;-) Even rocket scientists can't read minds. Will you create the patch or sho

Re: [fpc-pascal] FPImage and mult-page TIFF support

2016-12-09 Thread Mattias Gaertner
On Fri, 9 Dec 2016 12:39:54 +0100 (CET) mar...@stack.nl (Marco van de Voort) wrote: >[...] > Are there still no ways around the 64-bit storage format? I thought > TLazintfImage was meant to be a step in that direction? There are various image formats (TLazintfImage, TFPCompactImgRGBA8Bit,

Re: [fpc-pascal] FPImage and mult-page TIFF support

2016-12-07 Thread Mattias Gaertner
On Wed, 7 Dec 2016 09:58:13 + Graeme Geldenhuys wrote: > Hi, > > Does anybody know if FPImage supports multi-page TIFF's? Reading or > Writing. Do you mean multiple IFD? TFPReaderTiff and TFPWriterTiff support multiple IFD using multiple TFPCustomImage.

Re: [fpc-pascal] PascalScript broken by FPC 3.0 ?

2017-01-15 Thread Mattias Gaertner
On Sun, 15 Jan 2017 13:36:14 +0100 Bart wrote: > On 1/15/17, Kapibara Pas wrote: > > > What has happened? Is it possible to get it to work again without going back > > to Lazarus 1.4 and fpc 2.6.4? > > As a workaround you can switch back to fpc

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-01 Thread Mattias Gaertner
On Thu, 1 Dec 2016 15:15:36 -0200 luciano de souza wrote: > Yes, this is a very good feature. As I can't see, the single way to > not extrapass the space is the automatic layout. > To become perfect, it would be fantastic if there is also automatic > positioning like in Wx

Re: [fpc-pascal] Using the LCL without Lazarus

2016-12-01 Thread Mattias Gaertner
On Thu, 1 Dec 2016 14:57:42 -0200 luciano de souza wrote: > I am also blind and this topic really interesses me. > In the given example, heith and width were specified in pixels. > Is there a way to write the same example using automatic adjustments, > in other words,

Re: [fpc-pascal] Using the LCL without Lazarus

2016-11-30 Thread Mattias Gaertner
On Tue, 29 Nov 2016 20:42:36 -0500 "BobJ" wrote: >[...] > Begin web-site excerpt > > Using the LCL without Lazarus > > 1How to use the LCL without the Lazarus IDE? > 1.1Requirements > 1.2Introduction > 1.3The installation process > 1.4The settings >

Re: [fpc-pascal] For..in enumerator for generic records?

2016-11-30 Thread Mattias Gaertner
On Wed, 30 Nov 2016 18:24:11 +0700 Ryan Joseph wrote: >[...] I can wrap my head around nested types in classes because they’re >necessary for generics I just learned but nested classes feel messy. Is there >at least some namespace protection? Yes. And it follows

Re: [fpc-pascal] FPC clean room project

2017-01-02 Thread Mattias Gaertner
On Mon, 2 Jan 2017 05:23:06 + (UTC) Mr Bee wrote: > Hi all, > There's someone accusing that Free Pascal (and some parts of Lazarus) is just > a reverse engineering of Delphi. FPC runs on 80 platforms. Delphi only runs on MS Windows 32/64 and can cross compile to a few

<    2   3   4   5   6   7   8   9   10   11   >