procedure analyzeHistory(...a lot of arguments...); stdcall;
var
  i:       LongInt;
  bufpos:  LongInt = 0;
  balance: Double = 0;
  curtime: LongInt;

begin
   [...]

I did a lot of C in the last 6 months and almost no pascal.

I'm not really sure anymore if i am confusing something or what is
going on. The above will compile fine, except some little notes

Note: Local variable "$defaultbufpos" not used
Note: Local variable "$defaultbalance" not used

Somewhere I have read (and I could swear I did it already) that this
is the syntax to initialize a variable. I just had a session of over
an hour and dozens of crashes because bufpos is an index into some
complicated array that comes via the argument list from another
application that takes over a minute until it is restarted after such
a crash (this is no fun) and I really searched everywhere, the only
thing I didn't consider until the very end was that bufpos might not
be initialized.

It will not be initialized. Is this a bug or a feature?

Bernd

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to