Re: [fpc-pascal] Read-only global references

2011-03-06 Thread Marcos Douglas
On Sun, Mar 6, 2011 at 6:14 AM, Mark Morgan Lloyd wrote: > Marcos Douglas wrote: > Make a function to return a global variable does not make it read only. If I use your function like this: o := InitText; o := nil;  //this is the same xInitText = nil >>> >>> Disagree. You are ch

Re: [fpc-pascal] Read-only global references

2011-03-06 Thread Mark Morgan Lloyd
Marcos Douglas wrote: Make a function to return a global variable does not make it read only. If I use your function like this: o := InitText; o := nil; //this is the same xInitText = nil Disagree. You are changing the value of o, not of xInitText. xInitText is initialised once somewhere in th

Re: [fpc-pascal] Read-only global references

2011-03-05 Thread Aleksa Todorovic
On Sun, Mar 6, 2011 at 02:14, Marcos Douglas wrote: > On Sat, Mar 5, 2011 at 7:05 PM, Mark Morgan Lloyd > wrote: >> Marcos Douglas wrote: >>> >>> On Sat, Mar 5, 2011 at 8:24 AM, Mark Morgan Lloyd >>> wrote: Where a unit exports an instance of an object, what's best practice for ma

Re: [fpc-pascal] Read-only global references

2011-03-05 Thread Marcos Douglas
On Sat, Mar 5, 2011 at 7:05 PM, Mark Morgan Lloyd wrote: > Marcos Douglas wrote: >> >> On Sat, Mar 5, 2011 at 8:24 AM, Mark Morgan Lloyd >> wrote: >>> >>> Where a unit exports an instance of an object, what's best practice for >>> making this read-only? I'm referring to the object reference itsel

Re: [fpc-pascal] Read-only global references

2011-03-05 Thread Marcos Douglas
On Sat, Mar 5, 2011 at 8:15 PM, Marcos Douglas wrote: > On Sat, Mar 5, 2011 at 7:05 PM, Mark Morgan Lloyd > wrote: >> Marcos Douglas wrote: >>> >>> On Sat, Mar 5, 2011 at 8:24 AM, Mark Morgan Lloyd >>> wrote: Where a unit exports an instance of an object, what's best practice for

Re: [fpc-pascal] Read-only global references

2011-03-05 Thread Marcos Douglas
On Sat, Mar 5, 2011 at 7:05 PM, Mark Morgan Lloyd wrote: > Marcos Douglas wrote: >> >> On Sat, Mar 5, 2011 at 8:24 AM, Mark Morgan Lloyd >> wrote: >>> >>> Where a unit exports an instance of an object, what's best practice for >>> making this read-only? I'm referring to the object reference itsel

Re: [fpc-pascal] Read-only global references

2011-03-05 Thread Mark Morgan Lloyd
Marcos Douglas wrote: On Sat, Mar 5, 2011 at 8:24 AM, Mark Morgan Lloyd wrote: Where a unit exports an instance of an object, what's best practice for making this read-only? I'm referring to the object reference itself here, not properties of the object. Where I've done this in the past I've u

Re: [fpc-pascal] Read-only global references

2011-03-05 Thread Marcos Douglas
On Sat, Mar 5, 2011 at 8:24 AM, Mark Morgan Lloyd wrote: > Where a unit exports an instance of an object, what's best practice for > making this read-only? I'm referring to the object reference itself here, > not properties of the object. > > Where I've done this in the past I've used a function:

[fpc-pascal] Read-only global references

2011-03-05 Thread Mark Morgan Lloyd
Where a unit exports an instance of an object, what's best practice for making this read-only? I'm referring to the object reference itself here, not properties of the object. Where I've done this in the past I've used a function: interface function InitText: TFormattedString; implementation