Send fpc-pascal mailing list submissions to
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
or, via email, send a message with subject or body 'help' to
You can reach the person managing the list at
When replying, please edit your Subject line so it is more specific
than "Re: Contents of fpc-pascal digest..."
Today's Topics:
1. Re: TPicture (Graphics unit) (Leonardo M. Ram?)
2. Re: Records as properties and Delphi compiler error (Jonas Maebe)
3. optimised compiler options for "release" version
(Graeme Geldenhuys)
4. Re: optimised compiler options for "release" version (Bee)
5. Re: optimised compiler options for "release" version
(Graeme Geldenhuys)
----------------------------------------------------------------------
Message: 1
Date: Sun, 7 Jun 2009 08:03:38 -0700 (PDT)
From: Leonardo M. Ram?
Subject: Re: [fpc-pascal] TPicture (Graphics unit)
To: FPC-Pascal users discussions
Message-ID:
Content-Type: text/plain; charset=iso-8859-1
Thanks Graeme, I'll take a look at fpimage unit.
Leonardo M. Ramé
http://leonardorame.blogspot.com
--- On Sun, 6/7/09, Graeme Geldenhuys wrote:
> From: Graeme Geldenhuys
> Subject: Re: [fpc-pascal] TPicture (Graphics unit)
> To: "FPC-Pascal users discussions"
> Date: Sunday, June 7, 2009, 4:22 AM
> Leonardo M. Ramé wrote:
>
>
>> in Graphics.pas, but I can't find it in FPC. Is this
>>
> class replaced
>
>> by a similar one?
>>
> I you just want to load and manipulate an image, you should
> be able to use the fpimage.pp unit included with FPC. I you
> are looking for the TPicture class specifically, then you
> will have to use the Lazarus LCL (Lazarus Component Library)
> which is a clone of the Delphi VCL.
>
>
> Regards,
> - Graeme -
>
> -- ________________________________________________
> fpGUI - a cross-platform Free Pascal GUI toolkit
>
http://opensoft.homeip.net/fpgui/
>
> _______________________________________________
> fpc-pascal maillist -
>
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
>
------------------------------
Message: 2
Date: Sun, 7 Jun 2009 22:19:47 +0200
From: Jonas Maebe
Subject: Re: [fpc-pascal] Records as properties and Delphi compiler
error
To: FPC-Pascal users discussions
Message-ID:
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
On 07 Jun 2009, at 10:35, wrote:
> A high level, a class is like a record that has been modified to
> include
> functions and procedures. I know that I'm over simplifying thing
> here, please
> bare with me.
>
The difference you skip over is the fundamental reason why one works
and the other doesn't: a class is a pointer, while a record is a value.
> I'm trying to understand the logic employed by the creators of
> Delphi where
> they don't allow to write to the fields of a record type property,
> but if the
> property points to a class type, then anything goes.
>
In case of a class, the property returns a pointer (namely the pointer
to the class instance data), and then you (implicitly) dereference the
pointer and write data where it points to. In case of a record, the
property returns a record's value, and then (semantically) you change
the value of this returned record (not the value of the element of the
record that the property referred to).
This worked in previous FPC versions because rather than treating the
result of the property like a function result (which it has to,
because that's the semantical meaning of a property, so you can
transparently change them into getters/setters without breaking any
code), it treated it like a direct field access in case no getter/
setter existed. So rather than returning a record's value, the
property returned "a reference to a record".
> In the example bellow,
> where a property is of a class type, both Delphi and FPC compile the
> code,
> but there is no guarantee that the object referenced to by the
> property has
> been instantiated before the property is used (The programmer must
> instantiate the TTestProp class within TTestClass prior to any call
> made to xx
> the property). IMO, it would be a nice feature if the compiler could
> be
> modified to issue a warning in such a case.Again, I'm over
> simplifying, to
> the compiler, it would be similar to checking for a variable
> declaration
> before the variable is used.
>
Except that it's about dynamically allocated memory and depends on
interprocedural control flow graph analysis, which makes it immensely
more complex.
> I thing that the "error" in the way that FPC allows record
> properties to
> access the record fields could be handy if retained. Perhaps this
> feature
> could be reserved for objfpc mode. What are your thoughts on the
> matter?
>
Things will remain the way they are for the reasons explained above.
Jonas
------------------------------
Message: 3
Date: Mon, 08 Jun 2009 09:24:32 +0200
From: Graeme Geldenhuys
Subject: [fpc-pascal] optimised compiler options for "release" version
To: FPC-Pascal users discussions
Message-ID:
Content-Type: text/plain; charset=UTF-8
Hi,
I saw the following options recommended by the ExtPascal project for a
final "release" build of ones project. Does this really make a
difference in speed/performance and or executable size? How safe is it
to deploy such an executable to a wide variety of computers out there.
-O2pPENTIUM4 -CXpPENTIUM4 -XXsi -CfSSE
While developing my software I enable the following, and simply though
that for the final "release" version I'll remove the 'heaptrc' support
(-gl & -gh) and 'strip' the executable at the end.
-CX -Cr -O1 -gl -gh -XX
What is recommended? Stay with the more conservative options of FPC (-O2
-CX -XX) or the more processor specific optimisations. Please note, that
I do not know what exactly our clients run, processor wise (AMD or
Intel, singlecore or multi-core, etc...) I would hope everybody at least
runs a P4 and up on todays computers.
Regards,
- Graeme -
------------------------------
Message: 4
Date: Mon, 8 Jun 2009 15:46:10 +0700
From: Bee
Subject: Re: [fpc-pascal] optimised compiler options for "release"
version
To: FPC-Pascal users discussions
Message-ID:
Content-Type: text/plain; charset=ISO-8859-1
> How safe is it to deploy such an executable to a wide variety of computers out there.
>
ExtPascal is more for server side application. You should know where
it will be deployed and you can set more appropriate options. ;)