Martin Friebe wrote: > > The const version act like a global variable. It is set to 1 once at > some time before the 1st call to Foo. It will not be initialized again. > If Foo chages it, it will keep the changed value, even between calls to
Then this is a language issue. 'const' is clearly not the correct type declaration for that variable. As suggested suggested earlier, it would make more sense to maybe implement something like shown below - or whatever language construct the developers can come up with. var a: word = 1; static; 'const' or constant is simply not a very accurate description of the usage of that "writeable" variable/constant. It goes against the "easy readability design" of the Object Pascal language, and is very unclear as to the meaning of that typed constant. Regards, - Graeme - _______________________________________________________ fpGUI - a cross-platform GUI toolkit using Free Pascal http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal