Hi Please see my code inline

On 8/31/07, 12 12 <[EMAIL PROTECTED]> wrote:
> I tried to include sophisticated unit with math operations into my
> project.
> The unit worked fine in Delphi.
> But in Lazarus it get error when call TBits.SetSize(0):
> "Invalid bit index -1".
> I go to implementation of method TBits.SetSize and see this:
>
> "procedure TBits.setSize(value : longint);
> begin
      if (Value > 0) then
        grow(value - 1)
     else  ....
> end;"
>
> The method tries to set negative value of size!
>
> Who can help?
>

Please always check that you are able to do the operation without
arriving to overflow (for example).
A question is, why Value is longint and not a Cardinal, is there a
reason for negative size ?!

Ido
-- 
http://ik.homelinux.org/

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to