Re: [fpc-pascal] circular reference

2011-03-05 Thread Mattias Gaertner
On Sat, 5 Mar 2011 23:07:45 -0300 Marcos Douglas wrote: > If circular reference not is a good practice (even if to use a > implementation section) then I have to put all code, that works > together, in the same unit, right? No, only compatibility or your boss can force you to do that. You can us

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

[fpc-pascal] circular reference

2011-03-05 Thread Marcos Douglas
If circular reference not is a good practice (even if to use a implementation section) then I have to put all code, that works together, in the same unit, right? So, I ask: Is there a limit of characters at an unit? Marcos Douglas ___ fpc-pascal maillis

[fpc-pascal] TBlowfishDecryptStream flaw

2011-03-05 Thread Jorge Aldo G. de F. Junior
i have a problem with TBlowfishDecryptStream : Try lBuffer := TMemoryStream.Create; lSource := (aObject As TMemoryStream); lSource.Seek(0, soFromBeginning);

Re: [fpc-pascal] SHA1 of a TMemoryStream

2011-03-05 Thread Jorge Aldo G. de F. Junior
Found the solution, untyped var parameters expects a real variable so it "internally" generates a pointer out of the address of the variable. SHA1Buffer uses an untyped parameter, so, passing a pointer to it makes it try to hash the pointer itself (and the rest of the memory positioned exactly be

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] SHA1 of a TMemoryStream

2011-03-05 Thread Marco van de Voort
In our previous episode, Jorge Aldo G. de F. Junior said: > Uses > Classes, > SHA1; > > Var > Data : TMemoryStream; > Hash : TSHA1Digest; > > Begin > Data := TMemoryStream.Create; > Data.LoadFromFile('test6.pas'); Data.Position:=0; > Hash := SHA1Buffer(

[fpc-pascal] SHA1 of a TMemoryStream

2011-03-05 Thread Jorge Aldo G. de F. Junior
I need to perform a Hash of data stored at a TMemoryStream... But unfortunately, the following program spits out different results if i run it in sucession... Note that the file being read (test6.pas) never changes. Uses Classes, SHA1; Var Data : TMemoryStream; Ha

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:

Re[2]: [fpc-pascal] constref question

2011-03-05 Thread José Mejuto
Hello FPC-Pascal, Saturday, March 5, 2011, 12:24:24 PM, you wrote: >> it fails with a sigsegv. Are both expected to have the same behavior >> in this case ? (pointer to record). JM> "constref" is basically the same as "var" as far as passing JM> the parameter is concerned. That means that in the

[fpc-pascal] Free Pascal For Android

2011-03-05 Thread Lennie De Villiers
Hi, http://alexmogurenko.com/blog/programming/android-building-free-pascal-compiler-for-android/ How can I do this on a Mac OS? Thank you! Lennie De Villiers ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailm

[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

Re: [fpc-pascal] constref question

2011-03-05 Thread Jonas Maebe
On 05 Mar 2011, at 00:09, José Mejuto wrote: > Calling test is ok, but if I define test as: > > MyInterf = interface > [] >procedure test(constref param: pmyrec); safecall; > end; > > it fails with a sigsegv. Are both expected to have the same behavior > in this case ? (pointer to re