Hello Gary!
Wednesday October 16 1996, Gary Weinfurther writes to Ka'rlis Gobleja:
KG>> This shouldn't work because:
KG>> 1. You can't modify value of constants.
GW> Actually, you can. When you specify the explicit type of a constant it
is
GW> called a "typed constant" and is treated like a global variable with
local
GW> scope. It can be changed during the duration of the program.
You force me to read my Delphi 2.0 help and I found a very interesting topic
about "typed constants". There follows the essence of it:
Note. The $J compiler directive allows the declaration of typed constants
that can be modified. Typed constants declared in the default {$J-} state are
read-only and cannot be modified. For backwards compatibility with previous
versions of Delphi and Borland Pascal, typed constants declared in the {$J+}
state can be modified, and are in essence initialized variables. For new
applications, use of the {$J+} state is not recommended.
So, we both right.
Charles
---
---------------
* Origin: Charles point (2:5100/5.10)
|