Re: [fpc-pascal] client certificate mandatory and verification

2024-04-09 Thread Flávio Etrusco via fpc-pascal
Hello, This doesn't seem to have an easy solution right now. Many of the functions needed to set up openssl for this doesn't even seem to have imports in the FPC package. You'd then have to import the functions and implement a custom TSSLSocketHandler, and then hook it using either (fphttpapp.)App

Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-21 Thread Flávio Etrusco via fpc-pascal
Em sáb., 19 de nov. de 2022 18:27, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> escreveu: > (...) > >// this kind of constraint that uses T does not work yet >generic TList> = class > procedure Sort; >end; > > (...) > No? Sad, I use this all the time in Java. Be

Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-21 Thread Flávio Etrusco via fpc-pascal
; > begin > > Result:=(BRec.A-ARec.A); > > end; > > > > the results are: > > 750ms inlined > > 950ms not inlined, ~21% slower > > 835ms when compare func. is a parameter ~10% slower > > > > so the gain of inlining is higher for sorting primitive types. > V. > > __

Re: [fpc-pascal] How to inline CompareFunc to Sort method in generic abstract class

2022-11-18 Thread Flávio Etrusco via fpc-pascal
Em seg., 14 de nov. de 2022 15:26, Vojtěch Čihák via fpc-pascal < fpc-pascal@lists.freepascal.org> escreveu: > Hi, > > I wrote a generic abstract class - a list based on dynamic array (i.e. > array of T;) and this class can be specialized elsewhere with any type > (records or classes). > Part of t

Re: [fpc-pascal] Feature announcement: implicit generic function specializations

2022-04-30 Thread Flávio Etrusco via fpc-pascal
Hi, Em sáb., 30 de abr. de 2022 às 09:13, Mattias Gaertner via fpc-pascal escreveu: > > AFAIK it is planned for mode objfpc to support distinguishing types via > template count as in mode delphi: > > type > TMyClass = class > end; > generic TMyClass = class > end; > generic TMyClass = c

[fpc-pascal] Object-oriented file (path) handling library

2017-11-09 Thread Flávio Etrusco
Hello, is there something simliar to Java's java.io.File or java.nio.Path for FPC? Google makes me think there isn't... Best regards, Flávio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo

Re: [fpc-pascal] FPC Debug line numbers

2017-11-06 Thread Flávio Etrusco
2017-11-06 19:49 GMT-02:00 James Richters : > I've noticed that line numbers are sometimes off, sometimes quite a bit when > I receive a run-time error. I had one today, it specified the correct > function that was responsible for generating the error, however the line > number was way off, i

Re: [fpc-pascal] FPC install on windows with limited rights

2017-11-05 Thread Flávio Etrusco
Hi, 2017-11-02 17:54 GMT-02:00 Graeme Geldenhuys : > On 2017-11-02 07:17, Michael Van Canneyt wrote: >> >> The installer is made with inno setup. There are several inno extract >> tools >> available, e.g.: >> http://constexpr.org/innoextract/ > > > Thank you Michael, that worked perfectly. Strange

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

2016-11-21 Thread Flávio Etrusco
On Mon, Nov 21, 2016 at 10:09 PM, James Richters wrote: > I use notepad++ Vertical editing ALL THE TIME, you cannot do vertical editing > effectively with a proportional font. For those who aren't familiar with > it, you can hold down ALT and highlight many lines vertically making a very > ta

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Flávio Etrusco
On Wed, Feb 24, 2016 at 9:00 AM, Michael Van Canneyt wrote: > > > On Wed, 24 Feb 2016, Flávio Etrusco wrote: > >> On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort >> wrote: >>> >>> In our previous episode, Mark Morgan Lloyd said: >>>>

Re: [fpc-pascal] Bug in FPC 3.0.0 (was: Bug in FPC 3.0.0?)

2016-02-24 Thread Flávio Etrusco
On Wed, Feb 24, 2016 at 8:39 AM, Marco van de Voort wrote: > In our previous episode, Mark Morgan Lloyd said: >> > (remember recent discussion about IfThen pseudo-function). >> >> More relevant to your situation, I remember discussion about adding an >> identifier to WITH to use as an explicit sho

Re: [fpc-pascal] if-then-else expression

2016-02-02 Thread Flávio Etrusco
On Feb 2, 2016 7:41 PM, "geneb" wrote: > > (...) > > So it's not solving a /problem/ it's lessening an inconvienence(sp!). > > I would've gone with IIf(). :) > > > g. > The problem with Iff() is: 1) it either retains normal function behavior and thus has to evaluate both expressions (i.e. subopti

Re: [fpc-pascal] Methods for autoupdating fpc programs?

2015-10-05 Thread Flávio Etrusco
On Mon, Oct 5, 2015 at 1:58 PM, Jürgen Hestermann wrote: > > > Am 2015-10-04 um 19:11 schrieb mic...@gmail.com: >>> >>> But that makes no sense to me. If the OS is designed to potentially >>> remove >>> running programs (or parts of it) from memory it cannot allow overwriting >>> the file on disk

Re: [fpc-pascal] What's wrong with this simple test program

2014-12-19 Thread Flávio Etrusco
> > Delphi will compile this (like FPC does), but it will fail at runtime. Trust me here, I did the mistake a few times myself when I thought about too many other things. > > Regards, > Sven > Yes and this is just sad. Is there a reasonable case for not disallowing call of constructor as method ou

Re: [fpc-pascal] Brook Framework and Template Engines

2014-12-12 Thread Flávio Etrusco
On Fri, Dec 12, 2014 at 10:14 AM, silvioprog wrote: > On Fri, Nov 14, 2014 at 11:18 AM, Fabrício Srdic > wrote: >> >> Hello, >> >> What's the current status of the Brook Server Pages project? >> >> What's the recommended template engine to use with Brook Framework? >> >> Best regards > > Hello, >

Re: [fpc-pascal] Question about functions returning a string

2014-11-28 Thread Flávio Etrusco
On Fri, Nov 28, 2014 at 5:54 PM, Ewald wrote: > Hi, > > Take the following function prototype (in {$mode objfpc}{$H+} for the > record): > > Function SomeFunction(const Data: PChar; const Len: LongWord): > String; cdecl; public; > > Looking at the dissasembly of this function, I see that is ac

Re: [fpc-pascal] [OT] Generics and Type Constraints sample

2014-10-31 Thread Flávio Etrusco
On Fri, Oct 31, 2014 at 12:08 PM, silvioprog wrote: > On Fri, Oct 31, 2014 at 11:23 AM, Sven Barth > wrote: >> >> Am 30.10.2014 20:49 schrieb "silvioprog" : >> > TMath, constructor> = class >> >> It is not yet possible to reuse a type parameter directly in the parameter >> declaration. There al

Re: [fpc-pascal] fgl unit bug in generic class TFPGMap

2014-10-27 Thread Flávio Etrusco
On Mon, Oct 27, 2014 at 3:45 PM, Sven Barth wrote: > Am 26.10.2014 05:51, schrieb Flávio Etrusco: > >> On Fri, Oct 3, 2014 at 12:42 PM, Dennis Poon >> wrote: >>> >>> I think I found a bug in TFPGMap. >>> Hope some of you can verify it. >>> &g

Re: [fpc-pascal] fgl unit bug in generic class TFPGMap

2014-10-25 Thread Flávio Etrusco
On Fri, Oct 3, 2014 at 12:42 PM, Dennis Poon wrote: > I think I found a bug in TFPGMap. > Hope some of you can verify it. > > The bug seems to relate to the binary search used in the method "FIND" but > it does not occur for all string key values or at all capacity of the map. > Seems only occur a

Re: [fpc-pascal] how do I get Run Time info from a published method?

2014-10-01 Thread Flávio Etrusco
On Mon, Sep 29, 2014 at 11:54 PM, Dennis Poon wrote: > say for example: > > type > TmyClass = class > published > procedure Something (sender : Tobject);virtual; > end; > > var > myClass : TmyClass; > > then somewhere > > AddMethodToQueue(@myclass.Something); > > > I

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-17 Thread Flávio Etrusco
On Wed, Sep 17, 2014 at 4:38 AM, Frederic Da Vitoria wrote: > 2014-09-17 3:11 GMT+02:00 Flávio Etrusco : >> >> On Tue, Sep 16, 2014 at 8:09 PM, Philippe wrote: >> > on compiler implementation: >> > >> > I read in this list that the group lost months

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-16 Thread Flávio Etrusco
On Tue, Sep 16, 2014 at 8:09 PM, Philippe wrote: > on compiler implementation: > > I read in this list that the group lost months due a "with" problem. > > People use "with", and I guess lot of people use it! > > I checked the reference > http://www.freepascal.org/docs-html/ref/refsu58.html#x155-1

Re: [fpc-pascal] with statement using mulltiple objects

2014-09-16 Thread Flávio Etrusco
On Mon, Sep 15, 2014 at 2:55 AM, Sven Barth wrote: > On 14.09.2014 18:05, Philippe wrote: >> > > Take this example: > > === code begin === > (...) > > procedure TestWith; > var > p: PTest; > begin > New(p); > > with p^ do begin > Prop1 := 42; > Prop2 := 21; > end; > > Dispose(p);

Re: [fpc-pascal] Find/open files in search paths

2014-07-20 Thread Flávio Etrusco
On Sun, Jul 20, 2014 at 7:24 AM, denisgolovan wrote: > Hi all > > Does anybody know if Lazarus IDE has something similar to View units > (Ctrl+F12) tool, but searching in all search paths defined in project > settings? > It would allow to open modules much quicker than using standard Open file

Re: [fpc-pascal] Dynamic arrays, yet another pitfall

2014-02-09 Thread Flávio Etrusco
On Sun, Feb 9, 2014 at 12:34 PM, Jürgen Hestermann wrote: > (...) > With the following declaration and code: > > --- > var A,B: array of integer; > ... > SetLength(A,10); > B := A; > SetLength(B,20); > --- > > both variables A and B point to the same array with 20 E

Re: [fpc-pascal] Adding files to a tar file

2014-01-21 Thread Flávio Etrusco
On Tue, Jan 21, 2014 at 10:45 PM, luciano de souza wrote: > Hello all, > > This code should add all the files of a directory in a tar file. > > program e01; > {$mode objfpc}{$H+} > > uses > libtar, sysutils; > > var > archive: TTarWriter; > search: TSearchRec; > > BEGIN > archive := TTarWriter.cre

OT: (y) WAS: [fpc-pascal] How to stop a HttpApp via request?

2013-10-06 Thread Flávio Etrusco
>> >> Worked like a charm. Thank you very much Michael! (y) > > > What does (y) mean ? LOL I was puzzled too. And found a "funny" topic in Yahoo Answers :-o But in the end found it's a shortcut for Thumbs Up in Microsoft Messenger. -Flávio ___ fpc-pasca

Re: [fpc-pascal] Understanding virtual methods

2013-08-20 Thread Flávio Etrusco
On Tue, Aug 20, 2013 at 2:34 AM, Xiangrong Fang wrote: > Hi Flavio, > > Your findings confirmed mine, but not telling me why? I don't know why, maybe FPC used to be more strict about the use of inherited, or the docs are simply wrong. > It seems that the "virtual" keyword has no use at all! It

Re: [fpc-pascal] Build Lazarus Ide - On "make bigide": lazaruspackageintf.pas(102, 1) Fatal: Internal error 2013081601

2013-08-19 Thread Flávio Etrusco
On Tue, Aug 20, 2013 at 1:54 AM, Osvaldo Filho wrote: > Anyone coud help-me? > > user1@movotcf:~/Documentos/Desenvolvimento/pascal/svn/ex/lazarus1010$ make > bigide > make -C packager/registration > make[1]: Entrando no diretório > `/home/user1/Documentos/Desenvolvimento/pascal/svn/ex/lazarus1010/

Re: [fpc-pascal] Understanding virtual methods

2013-08-19 Thread Flávio Etrusco
On Mon, Aug 19, 2013 at 10:44 PM, Xiangrong Fang wrote: > Hi All, > > I am reading this document: > http://www.freepascal.org/docs-html/ref/refsu29.html and doing an > experiment with the following code: > > program project1; > {$mode objfpc}{$H+} > type > TBase = class > constructor Creat

Re: [fpc-pascal] Embedded ARM7 and long strings

2013-07-26 Thread Flávio Etrusco
On Fri, Jul 26, 2013 at 2:21 AM, Carsten Bager wrote: >> > The {$LONGSTRINGS OFF} directive is given at the beginning of the program, >> > and that >> > eliminates any problems with "long strings" using the 2.05 compiler. That >> > does not seem to >> > work with the new compiler. >> > >> > Is t

Re: [fpc-pascal] Embedded ARM7 and long strings

2013-07-25 Thread Flávio Etrusco
On Wed, Jul 24, 2013 at 4:07 AM, Carsten Bager wrote: > (...) > > The {$LONGSTRINGS OFF} directive is given at the beginning of the program, > and that > eliminates any problems with "long strings" using the 2.05 compiler. That > does not seem to > work with the new compiler. > > Is there a way

Re: [fpc-pascal] string memory management

2013-04-18 Thread Flávio Etrusco
On Fri, Apr 19, 2013 at 1:36 AM, Xiangrong Fang wrote: > Hi All, > > I'm studying how pascal manages strings. I wrote a simple test program: > > program stringtest; > {$mode objfpc}{$H+} > uses Classes, sysutils; > function test: PString; > var > s : string; > begin > New(Result); > Result^

Re: [fpc-pascal] "Function header doesn't match" error

2013-03-31 Thread Flávio Etrusco
On Sun, Mar 31, 2013 at 7:36 AM, Mark Morgan Lloyd wrote: > I wonder whether anybody could throw some light on a curious error. I've > just tried to move a class definition into the interface part of a unit, so > that I could easily add a class helper, but I'm getting an error > > borgumserverinte

Re: [fpc-pascal] TStream descendant to compress/decompress gzip data from another stream

2013-03-28 Thread Flávio Etrusco
On Thu, Mar 28, 2013 at 8:51 AM, José Mejuto wrote: > El 28/03/2013 1:06, Ewald escribió: > > Google found an old thread on lazarus mailing list about this ("FPC, gzip and stream") but without any solution, everything mentioned there has either the limitations of TCompressionStream/

Re: [fpc-pascal] Amazon S3

2013-03-21 Thread Flávio Etrusco
On Thu, Mar 21, 2013 at 1:39 PM, silvioprog wrote: > 2013/3/21 Marcos Douglas >> >> On Thu, Mar 21, 2013 at 12:30 PM, silvioprog wrote: >> > 2013/3/21 Sven Barth >> > (...) >> >> As I said to you, I can help to codify this part... but you didn't >> answer my last question (link #14) and now you

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-18 Thread Flávio Etrusco
On Mon, Mar 18, 2013 at 10:42 AM, Sven Barth wrote: > Am 18.03.2013 10:36 schrieb "Xiangrong Fang" : > (...) >> I cannot recall if there is already a notion of "alias" in free pascal, if >> not then we just introduce this idea within the scope of "with" expression. > > Which is why I suggested "ab

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-17 Thread Flávio Etrusco
On Sun, Mar 17, 2013 at 2:10 PM, Sven Barth wrote: > On 17.03.2013 15:33, Flávio Etrusco wrote: >> >> (...) >> static int IndexOf(List p_list, T p_item); > > > So you're basically just talking about generic methods here? Yes. Or actually not, it also in

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-17 Thread Flávio Etrusco
On Sun, Mar 17, 2013 at 6:59 AM, Sven Barth wrote: > On 17.03.2013 06:00, Flávio Etrusco wrote: >> >>type generic TAlias1 = class(TObject) >> function Alias1: T; >>end; > > This already works. In 2.7 I assume, because it doesn't work in 2.6.2.

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-17 Thread Flávio Etrusco
> On 17/03/2013 12:54, Marco van de Voort wrote: >> >> Since it is a pseudo variable declaration, I would assume VAR syntax and >> just use ":" ? This is indeed better. On Sun, Mar 17, 2013 at 10:51 AM, Martin wrote: > Or maybe it should require a "variable" declaration (or otherwise declared >

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-16 Thread Flávio Etrusco
On Sun, Mar 17, 2013 at 12:16 AM, Daniel Gaspary wrote: > On Sun, Mar 17, 2013 at 12:07 AM, 印場 乃亜 wrote: >> On 2013/03/17, at 11:37, Flávio Etrusco wrote: >>> Daniel, I find this hack as ingenious as atrocious ;-) >>> But thinking about it a bit, when FPC gets gener

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-16 Thread Flávio Etrusco
> Actually the only thing that makes me uncomfortable about the keyword "as", > is that > it strangely reminds me of SQL. I suppose that isn't a bad thing though. No problem with SQL, but "as" is already safe typecast, remember? ;-) -Flávio ___ fpc-pa

Re: [fpc-pascal] a proposal about "with" syntax

2013-03-16 Thread Flávio Etrusco
On Sat, Mar 16, 2013 at 10:14 PM, Xiangrong Fang wrote: >> > I don't know what's make it complex if there are 2 or more subject in >> > the with? >> >> Context. A conflict case the two object were of the same class. > > > Are you saying this case: > > with MyClassInstance1 as m, MyClassInstance2

Re: [fpc-pascal] Porting C macro

2013-03-12 Thread Flávio Etrusco
On Tue, Mar 12, 2013 at 5:30 AM, Darius Blaszyk wrote: > function GETNEXT(x: pLList): pLList; inline; > begin > exit(pLList(pchar(x) - pchar(pLList(nil)^.next))); > end; > > And let LList be declared as: > > LList = record > len: integer; > next, prev: pLList; > name: PChar; > nextname: PCha

Re: [fpc-pascal] Set size limit

2013-03-12 Thread Flávio Etrusco
On Mon, Mar 11, 2013 at 10:54 AM, Daniel Gaspary wrote: > On Mon, Mar 11, 2013 at 10:43 AM, Jonas Maebe > wrote: >> A set is basically a bitpacked array of boolean. Element X is set to true if >> you add X to the set, and to false if you remove it again. That means that >> if you have a set with

Re: [fpc-pascal] Porting C macro

2013-03-11 Thread Flávio Etrusco
On 3/11/13, Darius Blaszyk wrote: > > > I'm stuck porting a macro from C. Below is the original define. The > part I'm struggeling with is the right most part after the - sign. > > > #define GETNEXT(x) ((LList *)(((char *) x) - ((char *) & (((LList > *)0)^.next > > Does anyone know what is mea

Re: [fpc-pascal] Sigsegv with refcounting interface

2013-03-08 Thread Flávio Etrusco
> > var > vintfl: TInterfaceList; > BTW You should use a IInterfaceList variable > procedure addintf(const aintf: IUnknown); > (...) > addintf(TInterfacedObject.Create); > (...) It's a pity, but I don't know whether it's fixable (or if needs to be "fixed") in the compiler. The TInterfacedO

Re: [fpc-pascal] Result: string

2013-03-04 Thread Flávio Etrusco
On Mon, Mar 4, 2013 at 5:23 PM, Juha Manninen wrote: > On Mon, Mar 4, 2013 at 9:21 PM, José Mejuto wrote: >> What's the expected output of this code ? >> >> function TheA(): string; >> begin >> Result:=Result+'A'; >> end; >> >> writeln(TheA()); >> >> I thought that when the result type is an au

Re: [fpc-pascal] Regression? Problem passing a packed record to a overriden, virtual, abstract method in fpc 2.7.1.

2013-02-25 Thread Flávio Etrusco
On Mon, Feb 25, 2013 at 11:45 PM, Reimar Grabowski wrote: > On Tue, 26 Feb 2013 00:02:33 +0100 > Reimar Grabowski wrote: > >> But from command line it works. So it is not a FPC problem. > I am really sorry for communicating with myself but I have spoken too early. > Now I can reproduce the probl

Re: [fpc-pascal] Bitpacked dynamic array support

2012-12-17 Thread Flávio Etrusco
You can use sets or TBits. Unless you mean packed arrays of byte or word, etc. In this case you just declare "myvar: packed array of byte". -Flávio On Mon, Dec 17, 2012 at 5:46 PM, denisgolovan wrote: > Hi guys > > It looks like currently FPC does not support dynamic bitpacked arrays. > I wonder

Re: [fpc-pascal] Re: File Enumeration speed

2012-07-28 Thread Flávio Etrusco
On Sat, Jul 28, 2012 at 9:07 AM, leledumbo wrote: >> does the operating system keep an index somewhere ? > > ls doesn't, find does AFAIK. > "find" doesn't have any index over "ls". You may be thinking of "locate" (actually "located") that keeps a textfile with the list of files. Best regards, Fl

Re: [fpc-pascal] Creating video files

2012-06-20 Thread Flávio Etrusco
Apart from _the_ multi-platform commandline video converter, ffmpeg? http://ffmpeg.org/ It's the back-end for WinFF (and most other utilities like these). Also, I would expect VirtualDub to run fine with WINE. -Flávio On Wed, Jun 20, 2012 at 11:00 AM, Krzysztof wrote: > Hmm, external application

Re: [fpc-pascal] Currency and ABS(-674.59)

2012-03-06 Thread Flávio Etrusco
On Tue, Mar 6, 2012 at 12:11 PM, Jonas Maebe wrote: > > On 06 Mar 2012, at 13:28, michael.vancann...@wisa.be wrote: > >> As far as I know, Currency is always a scaled int64, and didn't interpret >> the >> request as a request to change that. > > > The problem is that on i386 (and in Delphi on i386

Re: [fpc-pascal] Re: Trim(): incompatibility with Delphi

2012-03-05 Thread Flávio Etrusco
On Mon, Mar 5, 2012 at 11:36 PM, leledumbo wrote: >> Fpc Trim(): Trim whitespace from the ends of a string. > > Where did you get that? The documentation > (http://www.freepascal.org/docs-html/rtl/sysutils/trim.html) doesn't say > so... > And a simple test confirms the docs (FPC 2.6): ShowMess

Re: [fpc-pascal] fcl-web TFPHttpServer component problem

2011-11-28 Thread Flávio Etrusco
> >> Also the HTTP server is >> implemented as a component (TComponent descendant), so I gather the >> thoughts was that some day they would like it to sit on the Lazarus >> component palette, where it will be dropped onto some form or data >> module - thus rendering that application frozen too. >

Re: [fpc-pascal] Free Pascal 2.6.0rc1 released

2011-11-07 Thread Flávio Etrusco
Yes, RolByte/Word/Dword/QWord are implemented in 2.6.0rc1. On Mon, Nov 7, 2011 at 8:27 PM, Peter wrote: > HI, > > Does this release include intrinsic ROL & ROR? > 'Bug' 6300 is shown as fixed, but I can find no mention in the new features > list. > > http://bugs.freepascal.org/view.php?id=6300 >

Re: [fpc-pascal] A list of CORBA interfaces - how?

2011-09-20 Thread Flávio Etrusco
Oops, seems I completely misread your post. The problem is cite is the kind of (or exactly) the one you're trying to fix :-$ Thanks for Marcos for pointing that out. -Flávio 2011/9/20 Flávio Etrusco : > On Tue, Sep 20, 2011 at 3:28 AM, Graeme Geldenhuys > wrote: >> Hi, >&

Re: [fpc-pascal] A list of CORBA interfaces - how?

2011-09-20 Thread Flávio Etrusco
On Tue, Sep 20, 2011 at 3:28 AM, Graeme Geldenhuys wrote: > Hi, > > I'm porting some of my old Delphi code which used interfaces > extensively. Since I moved to FPC years ago, I liked the idea of > CORBA-style interfaces, and mostly use them under FPC projects. > > Anyway, some of my code used IIn

Re: [fpc-pascal] How to do conditional compilation with macros

2011-09-18 Thread Flávio Etrusco
On Sun, Sep 18, 2011 at 9:19 AM, Marco van de Voort wrote: > In our previous episode, Fl?vio Etrusco said: >> > http://delphi.wikia.com/wiki/FreePascal_detection_and_versioning >> > >> > a typical usage: >> > >> > {$if FPC_FULLVERSION> 20204} >> > ? // means greater than 2.2.4 here >> > ?{$ifndef}

Re: [fpc-pascal] How to do conditional compilation with macros

2011-09-18 Thread Flávio Etrusco
On Sun, Sep 18, 2011 at 8:35 AM, Marco van de Voort wrote: > In our previous episode, Reinier Olislagers said: >> >> Have got FPC version 2.7.1 [2011/09/17] for i386 on Windows. >> >> What am I doing wrong? > > Not reading manuals?  :-) > > http://www.freepascal.org/docs-html/prog/progse5.html#x12

Re: [fpc-pascal] Multiple enumerators per class

2011-09-15 Thread Flávio Etrusco
On Thu, Sep 15, 2011 at 6:37 PM, Mattias Gaertner wrote: > Hi all, > > I found the Wiki page about the new for-in loop and found a > misinformation. It stated wrongly that it is not possible to > have multiple enumerators per class. It even gave a proposal > for a new feature that did not add anyt

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-12 Thread Flávio Etrusco
On Mon, Sep 12, 2011 at 2:25 AM, Jürgen Hestermann wrote: > > > Flávio Etrusco schrieb: >> >> "+=" can't be efficiently implemented with two operations (since >> concatenating the operand would be unexpected

Re: [fpc-pascal] Overloading the increment operator (+=)

2011-09-11 Thread Flávio Etrusco
On Sun, Sep 11, 2011 at 9:22 AM, Jonas Maebe wrote: > > On 10 Sep 2011, at 22:32, Flávio Etrusco wrote: > >> Does FPC allow overloading the += operator? If not, why? > > It is translated into "x:=x+y" at the parser level, and overload resolving > happens la

[fpc-pascal] Overloading the increment operator (+=)

2011-09-10 Thread Flávio Etrusco
Hello, If write a declaration without result it complains about invalid syntax; if I add a result it says "impossible operator overload". Does FPC allow overloading the += operator? If not, why? Best regards, Flávio ___ fpc-pascal maillist - fpc-pascal

[fpc-pascal] Suggestions on array allocation pattern/rules of thumb?

2011-08-19 Thread Flávio Etrusco
Hello, In Lazarus I found (pseudo)some code like this: procedure DoSomething(...) var v_Results: PInteger; v_ResultCount: Integer; begin v_Result := nil; PrepareData(..., v_Results, v_ResultCount); InternalDoSomething(v_Results, v_ResultCount); end; procedure PrepareData(..., var p_Resu

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-30 Thread Flávio Etrusco
On Sat, Jul 30, 2011 at 6:07 PM, Florian Klämpfl wrote: > Am 30.07.2011 22:54, schrieb Flávio Etrusco: >>>> >>>> Repeating myself, if there isn't something like CodeTools (i.e. only >>>> with text search) is way more difficult to search for operator &

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-30 Thread Flávio Etrusco
>> >> Repeating myself, if there isn't something like CodeTools (i.e. only >> with text search) is way more difficult to search for operator >> declarations. > > Why? Searching for operator+ is no more difficult than for function add ? > Blanks and linebreaks... Of course if one always use the sam

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-30 Thread Flávio Etrusco
>> >> And there is another advantage of using procedures/functions instead of >> overloading operators: >> You can search for the procedure to look what it actualy does. > > Not if you use function/procedure overloading. Then the situation is > exactly the same as for operators. > Repeating myself

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-29 Thread Flávio Etrusco
On Fri, Jul 29, 2011 at 7:31 AM, Henry Vermaak wrote: > On 29/07/11 06:39, Jürgen Hestermann wrote: >> >> >> Bernd schrieb: >>  > Occasionally I hear other people mentioning operator overloading as a >>  > must-have feature of any decent language but I wonder what real-world >>  > problems they ar

Re: [fpc-pascal] Re: operator overloading and counting references / creating / destoying anonymous instances

2011-07-28 Thread Flávio Etrusco
On Thu, Jul 28, 2011 at 1:59 PM, Bernd wrote: > 2011/7/28 Bernd : >> I have tried making >> use of Interface and TInterfacedObject and this seems to do what I >> want: for example when witing A := A + B the + operator would return a >> new instance and the reference counting would then automatical

Re: [fpc-pascal] Partially initializing array of records

2011-07-19 Thread Flávio Etrusco
On Tue, Jul 19, 2011 at 2:44 PM, Clay Stuart wrote: > Hello Everyone: > I've got an array of records that looks something like this: > type >       node = record >             foo : array[1..10] of integer; >             bar : array[1..10] of integer; >       end > var >      graph : array[1..5] o

Re: [fpc-pascal] Re: Object Files

2011-07-18 Thread Flávio Etrusco
On Mon, Jul 18, 2011 at 2:07 PM, leledumbo wrote: >> Are object files platform dependent? > > No >From the rest of your post I guess you mean "yes, they are dependent"? > >> Something tells me they ARE platform independent since they have to be >> linked in. > > Pardon me? That seems unrelated.

Re: [fpc-pascal] Platform independent alternatives

2011-06-23 Thread Flávio Etrusco
On Thu, Jun 23, 2011 at 3:18 PM, wrote: > Hi, > > I'm porting an app from Delphi to Lazarus when I came across a couple of > functions from the windows unit. Can anyone help me finding the platform > independent alternatives? > > TerminateThread You shouldn't use it, generally speaking. > Wait

Re: [fpc-pascal] Windows test program

2011-06-23 Thread Flávio Etrusco
On Thu, Jun 23, 2011 at 12:35 PM, Carsten Bager wrote: > Hi > I have this test program. It compiles and runs (shows) under Delphi (5.0). > I can compile (and run it) it under FPC (2.4.4) but it does not show > anything. I can see it in > the Windows Job list -> Processes but not under Programmes.

Re: [fpc-pascal] When the variable freed in Optimize compile

2011-06-08 Thread Flávio Etrusco
On Wed, Jun 8, 2011 at 6:17 AM, Jonas Maebe wrote: > > On 08 Jun 2011, at 10:57, Zaher Dirkey wrote: > >> Hi, I know when compile the project with optimize in Delphi the variable >> freed/allocated after the last line used. >> How can i make same in FPC, O3 not worked for me. > > FPC only reuses s

Re: [fpc-pascal] Suffix Trie implementation, please review

2011-05-24 Thread Flávio Etrusco
I guess you forgot the attachment? ;-) BTW, do you know the hashtrie component? http://www.softcomplete.com/hashtrie.asp Best regards, Flávio On Tue, May 24, 2011 at 1:48 PM, leledumbo wrote: > I've written a unit containing suffix trie implementation. It could be used > for: fast string existen

Re: [fpc-pascal] TimSort

2011-05-20 Thread Flávio Etrusco
On Fri, May 20, 2011 at 9:26 AM, Marco van de Voort wrote: > In our previous episode, michael.vancann...@wisa.be said: >> > ? >> > Is there already a TimSort implementation in fpc? >> > ? >> > http://en.wikipedia.org/wiki/Timsort >> >> Not to my knowledge. > > One reference implementation in the a

Re: [fpc-pascal] Inherit interface from 2 interfaces

2011-04-09 Thread Flávio Etrusco
On Fri, Apr 8, 2011 at 6:16 AM, wrote: > > > On Fri, 8 Apr 2011, Zaher Dirkey wrote: > >> 2011/4/7 Flávio Etrusco >> >>> On Wed, Apr 6, 2011 at 1:37 PM, Zaher Dirkey wrote: >>>> >>>> Can i do that? >>>> type >>>&

Re: [fpc-pascal] Inherit interface from 2 interfaces

2011-04-07 Thread Flávio Etrusco
On Wed, Apr 6, 2011 at 1:37 PM, Zaher Dirkey wrote: > Can i do that? > type >   IIntf3 = interface(IIntf11, IIntf2) > >   end; > > Thanks in advance. > -- > Zaher Dirkey > For Corba interfaces, yes. Not for COM interfaces. http://www.freepascal.org/docs-html/ref/refse39.html -Flávio ___

Re: [fpc-pascal] TDOMElement and multiple attributes

2011-03-27 Thread Flávio Etrusco
> > >> someone@somewhere:~/pascal/Projects/xmldemo$ cat test.xml >> >> >>   >> >> >> Looks like the order is governed by the length of the attribute name first >> and then alphabetically. >> Actually it isn't sorted by length, but it's case-sensitive. Mattias wrote: > Yes, that is what Compa

Re: [fpc-pascal] TreeView and Nonrecursion

2010-09-02 Thread Flávio Etrusco
On Wed, Sep 1, 2010 at 6:20 PM, Bihar Anwar wrote: > On 2 September 2010 3:53:34 AM, Vannus wrote: > >> i probably shouldn't open my mouth, as i don't quite understand the >> question... >> however FRED from the game Freespace let you design missions using a >> treeview. > > Just to make my questi

Re: [fpc-pascal] regex vs synregexpr unit

2010-06-06 Thread Flávio Etrusco
http://delphi.about.com/od/toppicks/tp/delphi-regular-expressions.htm The regex unit in SynEdit is an old version of the code from regexpstudio.com (which seems to be offline) is said to be very slow for processing large sets of data, like a whole file. In SynEdit it`s used to process single lines

Re: [fpc-pascal] FPC bug or brain bug ?

2010-05-27 Thread Flávio Etrusco
All TObject descendants have a VMT. The destructor is virtual, BTW. -Flávio On Thu, May 27, 2010 at 11:01 AM, Yann Bat wrote: > Hi, > > I don't understand why compilation of the program below failed in fpc > and objfpc mode. In tp and delphi mode it works as expected but in fpc > and objfpc mode

Re: [fpc-pascal] Where is the best place to declare an array?

2010-05-06 Thread Flávio Etrusco
On Thu, May 6, 2010 at 7:34 PM, Jonas Maebe wrote: > > On 06 May 2010, at 23:28, Werner Van Belle wrote: > >> In 'human' (haha) terms: >> >> - global variable access: write data into 'ds+constant' >> - local variables: write data into 'ss+bp+constant'. >> >> Since the latter involves a term more I

Re: [fpc-pascal] about dynamic array

2010-05-06 Thread Flávio Etrusco
On Thu, May 6, 2010 at 11:58 AM, Florian Klaempfl wrote: > José Mejuto schrieb: >> Hello FPC-Pascal, >> >> Thursday, May 6, 2010, 3:53:59 PM, you wrote: >> >> c> TList wraps TFPList, which is based internally on an array. So access >> c> is fast; insertion, deletion not. >> >> But it is faster tha

Re: [fpc-pascal] optional parameter

2010-05-03 Thread Flávio Etrusco
2010/5/3 spir ☣ : > Hello, > > A few questions on the topic: > > * Is it possible to define an optional parameter without default value? > > * Is it at all possible for an optional *argument* not to be the last in > actual call? Eg >     procedure p(a:Integer=0 ; b:Integer=0) >  How can the caller

Re: [fpc-pascal] deprecated syntax is inconsistent.

2010-04-29 Thread Flávio Etrusco
On Thu, Apr 29, 2010 at 6:44 AM, Michael Van Canneyt wrote: > On Thu, 29 Apr 2010, Graeme Geldenhuys wrote: >> Jonas Maebe het geskryf: (...) > > Jonas tried to explain that this is not possible. > > Consider the following - what  you propose - statements: > > Var >  A : Integer; >  deprecated : B

Re: Re[6]: [fpc-pascal] Published -> Public

2010-04-16 Thread Flávio Etrusco
On Fri, Apr 16, 2010 at 4:54 PM, José Mejuto wrote: > Hello FPC-Pascal, > > Friday, April 16, 2010, 9:06:45 PM, you wrote: > > FE> Published methods can be found with TObject.MethodAddress, that's how > FE> the lfm hook event handlers (and why Form event handlers are > FE> published). > > Yes, but

Re: Re[4]: [fpc-pascal] Published -> Public

2010-04-16 Thread Flávio Etrusco
On Fri, Apr 16, 2010 at 8:32 AM, José Mejuto wrote: > Hello FPC-Pascal, > > Friday, April 16, 2010, 8:42:32 AM, you wrote: > > ZD> What useful for put procedure in Publish? > > I do not know :-? I'll ask in the Lazarus list. > > -- > Best regards, >  José > Published methods can be found with TOb

Re: [fpc-pascal] nested procedure as parameter question

2010-04-15 Thread Flávio Etrusco
On Thu, Apr 15, 2010 at 2:51 PM, Bruce Bauman wrote: > I am porting a large amount of existing Pascal code (MetaWare) to Free > Pascal. Unfortunately, this code makes extensive use of nested > procedures, and the nested procedures often reference variables in the > enclosing scope. > > I know that

Re: [fpc-pascal] Poss FPC Bug.

2010-04-05 Thread Flávio Etrusco
On Mon, Apr 5, 2010 at 8:29 PM, Justin Smyth wrote: > guys i've been working on a port of an application that uses the Com > IPersist Interface , one of its procedures seems to be wrong , > > > Function GetClassId(clsid:TClsId):HResult; StdCall; > > yet i believe it should be > > Function GetClass

Re: [fpc-pascal] More memory leaks and other problems: request for review of probably stupid mistake

2010-03-31 Thread Flávio Etrusco
> > If you still want to use records, before the Dispose(APResultRecord) > set the ansistring fields to '', this will garantee that the reference > is freed. > Or call Finalize() on them. Flávio ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.or

Re: [fpc-pascal] var parameters under 64-bit GDB?

2010-03-25 Thread Flávio Etrusco
On Thu, Mar 25, 2010 at 9:41 AM, Graeme Geldenhuys wrote: > Hi, > > I'm using FPC 2.4.1 with GDB 6.8 under Ubuntu 8.04.2 LTS on a all 64-bit > system. > > > All var parameters [even of simple types like Integer, Boolean etc.] show > up as memory addresses instead of their values when debugged. I b

Re: [fpc-pascal] modulo of negative dividend

2010-03-13 Thread Flávio Etrusco
2010/3/13 Martín Marqués : > I'm checking the mod binary operator, and I found out that if the > dividend is negative, it gives a negative result. AFAIK, mod gives an > integer between 0 and d-1, where d is the divisor. > > Isn't this the right behavior? > > -- > Martín Marqués This is the mathema

Re: [fpc-pascal] New wiki, ftp and mailing list server planned

2010-03-12 Thread Flávio Etrusco
On Fri, Mar 12, 2010 at 11:06 PM, Felipe Monteiro de Carvalho wrote: > 2010/3/12 Flávio Etrusco : >> >From the wiki, it's more interesting to pay in Euros, right? >> Is the German PayPal only a localized version, or are they separate >> corporations and I'd have

Re: [fpc-pascal] New wiki, ftp and mailing list server planned

2010-03-12 Thread Flávio Etrusco
>From the wiki, it's more interesting to pay in Euros, right? Is the German PayPal only a localized version, or are they separate corporations and I'd have to create a different account? And is there a way to use the German site in English? ;) Best regards, Flávio On Fri, Mar 12, 2010 at 7:07 PM,

Re: [fpc-pascal] floating point an FPC

2010-03-02 Thread Flávio Etrusco
On Mon, Mar 1, 2010 at 6:32 PM, ik wrote: > > http://ik.homelinux.org/ > > > On Mon, Mar 1, 2010 at 23:20, Jerry wrote: >> >> Don't compare floating points. Ever. Now you see why. > > So if I need for example to compare currency or something that is floating > point, how do I do that ? > Let me

Re: [fpc-pascal] String buffer

2010-02-09 Thread Flávio Etrusco
On Tue, Feb 9, 2010 at 8:50 AM, Honza wrote: > Probably just reinventing the wheel - I was not able to quickly find a > String builder/buffer elsewhere. > > Source code for anyone possible interested is published on a blog (no > ads there, so I hope it's OK to post the link): > > http://freepascal

Re: [fpc-pascal] String types in a wider perspective

2009-12-02 Thread Flávio Etrusco
On Tue, Dec 1, 2009 at 2:28 PM, Jonas Maebe wrote: > > On 01 Dec 2009, at 18:03, Luca Olivetti wrote: > >> I always protect multithreaded sting access with a critical section. >> Do you mean it is not needed? > > The reference counting of ansistrings/... is thread safe. Accessing the > characters

Re: [fpc-pascal] readonly variables

2009-11-30 Thread Flávio Etrusco
On Sun, Nov 29, 2009 at 1:11 PM, Jonas Maebe wrote: > > On 29 Nov 2009, at 16:51, Anthony Walter wrote: > >> Having said all that, Jonas, what is the actual implemented behaviour >> of FPC? Does it 0 initialize heap memory at startup or not? > > I guess you mean global data rather than heap (heap

  1   2   >