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 thought about that before posing the question :). > > > > > But in this case I'm wondering why you want to give a pointer instead > > of the real type? > > > did you mean this ? : > > procedure ChangeRec1(const Rec: TSomeRec); > begin > Rec.a:= 'string A'; > end;
Yes. > Because I can't pass a PSomeRec to that function, only a TSomeRec Where is the problem? If you allocated the memory by new() as in your example you could call ChangeRec1(RecPtr^); and the compile (hopefully) uses the pointer. But in this case you will get an compiler error because you can't change a constant value. It seemed that I didn't get the point from your original mail: Name the procedure CHANGERec1 and change a value but declare the parameter as constant. > Otherwise, I don't know what you mean.. Now _I_'m a little bit confused. Michael _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal