I have always found this an unintuitive rule and have been caught out by it
several times. It just seems natural that if a variable is initialised to 0
in a subroutine, that it will be so initialised every time you call the
routine. Defining global variables by the back door like this is not only
unintuitive, but dangerous. I also contravenes everything I have ever
learnt about encapsulation (or call it scope). Result is that I just do not
use initial values at all, except in module headers (where it is clear that
you have a static variable).
So you definitely have my vote for change!
Adriaan
--
--------------------------------------+-------------------------------
Dr Adriaan Joubert | Phone: +44-171-975 5168
Albourne Associates Ltd | Fax: +44-171-720 9202
QMW, Mile End Road | e-mail: [log in to unmask]
London E1 4NS |
--------------------------------------+-------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|