The SizeOf operator can determine the size of something which changes at runtime.
But the size of something may make sense even if that thing does not exist.
For example, an Int is 4 bytes. So every element of an Int array is 4 bytes.
With Debug On 'Print SizeOf( a[9] )' is an out of bounds error. It is still reasonable to say a[9] is 4 bytes even if those those bytes don't really belong to the array.
But the size of something may make sense even if that thing does not exist.
For example, an Int is 4 bytes. So every element of an Int array is 4 bytes.
Local a:Int[] = New Int[ Rand( 5 ) ] Print Print SizeOf( a ) Print Print SizeOf( a[0] ) Print SizeOf( a[9] ) Print Print a[0] Print a[9]Here the size of the array is not known until the program runs. But the size of any element a[whatever] is 4 bytes.
With Debug On 'Print SizeOf( a[9] )' is an out of bounds error. It is still reasonable to say a[9] is 4 bytes even if those those bytes don't really belong to the array.