[fpc-pascal] Constant object

2006-05-01 Thread Michael Müller
How can I declare a constant object? var MyTest: TObject; begin MyTest := TObject.Create; end. works (for sure). How can I declare 'const'? Thanks Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mai

Re: [fpc-pascal] const parameter writeable

2006-05-01 Thread Michael Müller
On Mon, May 01, 2006 at 12:07:55PM -0600, L505 <[EMAIL PROTECTED]> wrote: > > > > Only the pointer itself is the parameter and read-only. Where the pointer > > > points to is irrelevant. > > I remember this from using classes where you can still access the class > properties - > should have thou

Re: [fpc-pascal] const parameter writeable

2006-05-01 Thread L505
> > > did you mean this ? : > > > >procedure ChangeRec1(const Rec: TSomeRec); > >begin > > Rec.a:= 'string A'; > >end; > > > > Because I can't pass a PSomeRec to that function, only a TSomeRec > > Then pass a PSomeRec^ to it if you don't intend to change the pointer > anyway.

Re: [fpc-pascal] const parameter writeable

2006-05-01 Thread Jonas Maebe
On 01 May 2006, at 20:07, L505 wrote: did you mean this ? : procedure ChangeRec1(const Rec: TSomeRec); begin Rec.a:= 'string A'; end; Because I can't pass a PSomeRec to that function, only a TSomeRec Then pass a PSomeRec^ to it if you don't intend to change the pointer anywa

Re: [fpc-pascal] const parameter writeable

2006-05-01 Thread L505
> > Only the pointer itself is the parameter and read-only. Where the pointer > > points to is irrelevant. I remember this from using classes where you can still access the class properties - should have thought about that before posing the question :). > > But in this case I'm wondering why yo

Re: [fpc-pascal] Problem with compile Gtk2 for version 2.6

2006-05-01 Thread Marco van de Voort
> I tried to compile gtk2 for arm linux. > I download the package/extra/gtk2 source from svn server and I use the > following command to compile it: > > make OS_TARGET="linux" CPU_TARGET="arm" FPCCPUOPT="O2" PP="ppcarm" > COMPILER_OPTIONS="-CX -XX -Xs" > > With the original source (GTK2_2), it

[fpc-pascal] Problem with compile Gtk2 for version 2.6

2006-05-01 Thread smartkenny
Hello, all I tried to compile gtk2 for arm linux. I download the package/extra/gtk2 source from svn server and I use the following command to compile it: make OS_TARGET="linux" CPU_TARGET="arm" FPCCPUOPT="O2" PP="ppcarm" COMPILER_OPTIONS="-CX -XX -Xs" With the original source (GTK2_2), it c

Re: [fpc-pascal] const parameter writeable

2006-05-01 Thread Jonas Maebe
On 01 May 2006, at 08:11, Michael Müller wrote: - 'const': gives pointer, content read-only The compiler can handle const parameters in any way it wants, and it may even differ among different cpu's and calling conventions. Sometimes they are passed by value, sometimes by reference. It