On Feb 14, 2006, at 11:10 AM, Robert Woodhead wrote:
When declaring a property, you are allowed to set the name, type and
initial value.
If you declare a property derf as Integer = -1, when the object is
created, derf gets set to -1.
The property editor happily lets you make an array declaration with a
constant initializer, ie:
derfArray(10) as Integer = -1
but at runtime, all elements of derfArray() are set to 0, not -1.
Either (a) the IDE should not let you set an initial value when the
property is an array, or (b) much better, it should initialize all
elements of the array to the desired initial value. It's already
setting them to 0 (or nil), so it can't be that tough...
Actually, I suspect it's not so much setting them to zero, as it is
preallocating a block of memory that already was zeroed out (bytes set
to 0.)
This is - IMHO - why 'uninitialized' variables in RB have some
zero-equivalent. (0 for Integers, 0.0 for Single/Double, False for
Boolean, "" for strings, and nil for object references)
http://www.realsoftware.com/feedback/viewreport.php?reportid=kprwphjl
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
William H Squires Jr
4400 Horizon Hill #4006
San Antonio, TX 78229
[EMAIL PROTECTED] <- remove the .nospam
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>