[fpc-pascal] readonly variables

Anthony Walter sysrpl at gmail.com
Sat Nov 28 21:15:35 CET 2009


> This is not guaranteed in any way. It happens to be so most of the time,
> but your code should never assume this is so, except for global Ansistring
> variables.

If all globals weren't initialized to 0 a lot of code from lots of
people would potentially be in trouble. I've been using Pascal/Delphi
for a very long time. Trust me I know my stuff.

>From the language specification:

Section: Data Types, Variables, and Constants
Sub-section: Declaring Variables
Page: 102

"If you don't explicitly initialize a global variable, the compiler
initializes it to 0."



More information about the fpc-pascal mailing list