Re: [fpc-pascal] private integer is an illegal counter variable

2009-11-30 Thread Flávio Etrusco
On Sat, Nov 28, 2009 at 7:12 AM, Jürgen Hestermann wrote: >> And there are many reasons why there are so many string types nowadays. > > True. > >> Simply use {mode objfpc}{$h+} like lazarus suggests. > > I think the root cause of all these problems are generic types. They cause > more trouble tha

Re: [fpc-pascal] How to solve "variable does not seem to be initialized" compiler hint.

2009-11-19 Thread Flávio Etrusco
On Thu, Nov 19, 2009 at 4:18 AM, Jonas Maebe wrote: > > On 19 Nov 2009, at 07:35, Graeme Geldenhuys wrote: > >> Somebody did once attempt to correct the var parameter to out parameter >> in FillChar, but got to many errors. Probably not a high priority issue, >> so the problem was simply swept und

Re: Re[2]: [fpc-pascal] How to solve "variable does not seem to be initialized" compiler hint.

2009-11-18 Thread Flávio Etrusco
On Tue, Nov 17, 2009 at 7:19 PM, JoshyFun wrote: > Hello FPC-Pascal, > > Tuesday, November 17, 2009, 8:47:03 PM, you wrote: > > c> Can the Fill... functions be changed to have the first parameter "out" > c> instead of "var" ? Surely they don't use it as an input parameter. > > Write your own "fill

[fpc-pascal] Ubuntu PPA for fpc 2.4rc1?

2009-11-12 Thread Flávio Etrusco
Hello, will somebody please create an Ubuntu PPA for newer releases of fpc? ;-) I guess this would be trivial to the maintainer of fpc packages in Ubuntu, but if it's not the case/they don't want to, is it ok if do (try)? Regards, Flávio ___ fpc-pascal

Re: [fpc-pascal] Compiler Warning: Constructor should be public

2009-11-10 Thread Flávio Etrusco
On Tue, Nov 10, 2009 at 10:56 AM, Graeme Geldenhuys wrote: > Anthony Walter wrote: >> >> In my opinion the warning should be removed, or at least able to be >> suppress through a switch. I beginning to make the transition to cross > > The compiler is 100% and I think it should actually raise an Er

Re: [fpc-pascal] Gecko / Firefox / XPCOM

2009-05-24 Thread Flávio Etrusco
On Sun, May 24, 2009 at 9:30 AM, Jonas Maebe wrote: > > On 21 May 2009, at 22:34, Henrik Genssen wrote: > >> nsMemory.pas(157,17) Error: Incompatible types: got "Realloc(Pointer, >> LongInt):^untyped" expected "> Pointer, LongInt):^untyped;Register>" > > As the error message says: the compiler exp

Re: [fpc-pascal] Gecko / Firefox / XPCOM

2009-05-21 Thread Flávio Etrusco
On Thu, May 21, 2009 at 5:34 PM, Henrik Genssen wrote: > (...) > nsMemory.pas(155,13) Warning: Some fields coming before "GetMem" weren't > initialized > nsMemory.pas(157,17) Warning: Some fields coming before "ReallocMem" weren't > initialized > nsMemory.pas(157,17) Error: Incompatible types: g

Re: [fpc-pascal] Constructors & Destructors 101

2009-04-03 Thread Flávio Etrusco
> C) Just out of curiosity, am wondering why FreeAndNil is global procedure > instead of a method/destructor of TObject.   I am guessing it is > for compatibility with Delphi which may or may not have a reason? A method could not act the way FreeAndNil works (zeroing a local pointer variable). It

Re: [fpc-pascal] Vandalism

2008-03-12 Thread Flávio Etrusco
Stopbadware.org (actaully Firefox 3 "phishing protection") reports the links as from an "attack site". Maybe the pages should be taken offline until they're fixed? Best regards, Flávio On Tue, Mar 11, 2008 at 8:11 PM, C Western <[EMAIL PROTECTED]> wrote: > There seems to be some vandalism on the

Re: [fpc-pascal] Empty string

2008-03-06 Thread Flávio Etrusco
To the OP: are you using the AnsiString as a buffer (that contains "several" strings)? Otherwise, using "MyString <> '' " would do because #0 is only valid as terminator in UTF-8 too. BTW, IIRC Delphi would generate faster code for the above construction instead of "Length(MyString) <> 0" because

Re: [fpc-pascal] FPC now 3rd in shootout

2007-11-06 Thread Flávio Etrusco
> The compiler uses shortstrings internally, which are the fastest string > type. Pchars are between ansistrings and strings, but offer the least > comfort of all. With the exception that not having a compiler flag to check shorstrings' overflows make for for some tricky to debug problems ;-) -Fl

Re: [fpc-pascal] FPC now 3rd in shootout

2007-11-06 Thread Flávio Etrusco
On 11/6/07, S. Fisher <[EMAIL PROTECTED]> wrote: > > --- Dani�l Mantione <[EMAIL PROTECTED]> wrote: > > > > Is it true that a slow program has a worse effect on the shootout > > > results than a missing program? That seems wrong to me. > > > > There has been a long discussion on the Shootout forum

Re: [fpc-pascal] fast text processing

2007-11-01 Thread Flávio Etrusco
Recent versions of JCL include a pcre header, too. Even a .obj is provided for linking statically :-) -Flávio On 10/31/07, Jeff Pohlmeyer <[EMAIL PROTECTED]> wrote: > > > the easiest is simply making a FPC header to > > pcre, it might be useful even. > > I did that, once upon a time... > > h

Re: [fpc-pascal] fast text processing

2007-11-01 Thread Flávio Etrusco
What about the TRegExpr library? http://www.regexpstudio.com/TRegExpr/TRegExpr.html The license is MIT-like... Cheers, Flávio On 10/31/07, Bee <[EMAIL PROTECTED]> wrote: > > > Well, considering that perl's or Python's speed greatly rely on the > > underlying C-implementation of (at least) particu

Re: [fpc-pascal] a book about freepascal [off-topic]

2007-06-18 Thread Flávio Etrusco
There are many Portuguese speakers in the list that certainly will be glad to help too ;-) Best regards, Flávio (from Brazil) On 6/18/07, Francisco Reyes <[EMAIL PROTECTED]> wrote: Daniël Mantione writes: > I placed an order at their European distributor http://www.infobooks.pt; > this seems

Re: [fpc-pascal] gdk_window_get_frame_extents

2007-06-03 Thread Flávio Etrusco
On 6/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > var > grect :PGdkRectangle; > > begin > gdk_window_get_frame_extents(GDK_WINDOW(widget^.window),@grect); > > > configure_event := True; > end; > === fpc header for the gdk function is

Re: [fpc-pascal] gdk_window_get_frame_extents

2007-06-03 Thread Flávio Etrusco
I don't have access to FPC right now, but it seems as if PGdkRectangle is a pointer type already, not a record type? -Flávio On 6/3/07, Airr <[EMAIL PROTECTED]> wrote: Hello, all. I'm trying to get the current position and size of a GTK2 gtkwindow using the following: === function configure_e

Re: [fpc-pascal] Bugs in 2.1.4 ?

2007-06-01 Thread Flávio Etrusco
I'm not sure if the following are bugs of 2.1.4: I'm not sure either ;-) But since these seem too absurd to be true, just make sure: 1) A variable used in the body of a function that I defined, while it is not defined in the function's var part, the file compiles successfully. - you're not

Re: [fpc-pascal] Timers in FPC

2007-06-01 Thread Flávio Etrusco
BTW, while I'm still somewhat on-topic (but quite lazy ;-) , is there a high-resolution timer in FCL? If not, what about including Martin Waldenburg's qmwfasttime? Shall I file a request in Mantis? Best regards, Flávio ___ fpc-pascal maillist - fpc-p

Re: [fpc-pascal] Value of runner variable after a for loop

2007-03-12 Thread Flávio Etrusco
I would NEVER rely on this in production code. The value of the control variable of a For loop after execution should never be relied upon. A simple change in the compiler at some future point could break a lot of your code. To be honest I would call it a bug if a comipler didn't warn about it (

Re: [fpc-pascal] Value of runner variable after a for loop

2007-03-12 Thread Flávio Etrusco
On 3/12/07, Michael Van Canneyt <[EMAIL PROTECTED]> wrote: On Mon, 12 Mar 2007, Luiz Americo Pereira Camara wrote: > Take the following example: > > for i:= 0 to 2 do; > WriteLn(i); > > Can i safely assume that after the for loop the value of "i" is 2? No. I think it is even specified in the

Re: [fpc-pascal] dll with windows impossible???

2007-01-24 Thread Flávio Etrusco
I am trying again without any hope, to use dll in a wondows application. (...) More and more I think I am going to translate my code in C, because FPC seems unable to manage properly dll library. Thanks for your help. Do you think whining and shouting "I will turn to C" will get you better repl

Re: [fpc-pascal] GetMem question

2006-12-01 Thread Flávio Etrusco
() var lList : PPropList; begin lList := nil; // <<== New line, I expect to fix a FPC warning ... GetMem(lList, lSize); But it's created a warning in BDS2006 Variable assigned to LList never used - Simply put: the parameter is always di

Re: [fpc-pascal] Slow compilation

2006-09-02 Thread Flávio Etrusco
Well, "fast" is relative... FPC is clearly slower than Delphi and Kylix compiler; I'd say it feels like Delphi is two or three time as fast as FPC. OTOH, FPC is several times faster than Mono, gcc or MS VisualC. And I'd say it's on par with Sun's javacc... -Flávio On 9/2/06, Felipe Monteiro de C

Re: Re[2]: [fpc-pascal] a suggestion...

2006-05-24 Thread Flávio Etrusco
On 5/24/06, Пётр Косаревский с mail.ru <[EMAIL PROTECTED]> wrote: FK> Jonas Maebe wrote: >> On 24 mei 2006, at 17:30, Florian Klaempfl wrote: >> >>> Not really because it is simply a tar ball of several .tar.gz. Because >>> gzip is spread wider, we use this instead of bzip2/7zip. >> Isn't bzip2 a

Re: [fpc-pascal] Typecasting by accident

2006-05-20 Thread Flávio Etrusco
I stand corrected. I've just checked Delphi5 and indeed it allows a direct typecast from ansistring to any object/class :-/ But Delphi also allows direct cast from enumeration value to pointer (which FPC doesn't allow), so maybe this is another nice oportunity to be stricter than Delphi ;-) Cheer

Re: [fpc-pascal] Typecasting by accident

2006-05-19 Thread Flávio Etrusco
ommon ancestor before being cast to any other class, but maybe it's just me ;-) -Flávio On 5/15/06, Jonas Maebe <[EMAIL PROTECTED]> wrote: On 15 mei 2006, at 18:09, Flávio Etrusco wrote: >> It's a CAST dude! Exception_Message is being case as Not_Now. That >> should >&

Re: [fpc-pascal] Typecasting by accident

2006-05-15 Thread Flávio Etrusco
On 5/14/06, Matt Emson <[EMAIL PROTECTED]> wrote: > Weird, I wouldn't expect OBJFPC mode to allow automatic conversion > from AnsiString to Pointer... Um... > raise Not_Now (Exception_Message); It's a CAST dude! Exception_Message is being case as Not_Now. That should work fairly well in m

Re: [fpc-pascal] Typecasting by accident

2006-05-12 Thread Flávio Etrusco
Weird, I wouldn't expect OBJFPC mode to allow automatic conversion from AnsiString to Pointer... -Flávio On 5/12/06, Vinzent Hoefler <[EMAIL PROTECTED]> wrote: Just found a bug of mine I was wondering about since about three days, and wanted to share the fun with you: -- 8< -- // "How to rais

Re: [fpc-pascal] google summer of code?

2006-04-27 Thread Flávio Etrusco
On 4/27/06, Alexandre Leclerc <[EMAIL PROTECTED]> wrote: > 2006/4/27, Jonas Maebe <[EMAIL PROTECTED]>: > > The application was rejected (without explanation). > > Maybe because this is not tax deductible for google, because this is > not a tax-deductible-foundation. > > I'm sure summer of code does

Re: [fpc-pascal] fpc + linux, problem with VarArrayCreate, variant

2006-04-23 Thread Flávio Etrusco
You can simplify the use-case a lot: simply trying to assign any value to a Variant after it's been assigned an array throws an exception. It seems one is not allowed to reassign a Variant which was already initialized to a VarArray - which IMHO is a good thing ;-) Variable reuse should have a capi

Re: [fpc-pascal] Re: OpenDelphi.org

2006-03-16 Thread Flávio Etrusco
Hey, great idea! How come I never thought of it? ;-) It'll be on my to-do list for SynEdit :-) -Flávio On 3/16/06, memsom <[EMAIL PROTECTED]> wrote: > > > Note that there have been discussions in the past that e.g. for release > > purposes could be generated per platform that has the necessary in

<    1   2