On 31/08/2007, Skybuck Flying <[EMAIL PROTECTED]> wrote: > From: "ik" <[EMAIL PROTECTED]> > >> "procedure TBits.setSize(value : longint); > >> begin > > > if (Value > 0) then > > grow(value - 1) > > else ....
should work, but dunno if it's the correct solution. > > This is your attempt at a bug fix. (next time mention it cause it looked > kinda confusing) > > However you didn't supply the full bug fix. > > What if he wants to set the size to zero to reduce the memory to zero. > > That should be possible ! possibly, but this is how it's advertised: http://community.freepascal.org:10000/docs-html/rtl/classes/tbits.grow.html http://community.freepascal.org:10000/docs-html/rtl/classes/tbits.size.html this isn't delphi compatible, as far as i can see from my delphi 7 docs. > > Suppose it was a longword. > > 0 - 1 wraps back to 4 billion. > > That would have allocated 4 billion bits. no, since grow checks for errors and raise the error. > Also the -1 seems a logical coding mistake. (I am not sure what grow does) read the code, it's in bits.inc ;) henry _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
