question about Type global initializers...

BlitzMax Forums/BlitzMax Beginners Area/question about Type global initializers...

fredborg(Posted 2005) [#1]
Hi,

The following:
Type mytype
	Global array:Float[4]
EndType
Produces this error:
Compile Error: Type global initializers must be constant

But this:
Type mytype
	Global array:Float[]
EndType
Compiles without any problems. Surely the first one is more constant than the second...or am I mistaken?


Gabriel(Posted 2005) [#2]
I agree, but :

http://blitzbasic.com/Community/posts.php?topic=48801#542955


Curtastic(Posted 2005) [#3]
So am I supposed to assume that the line,
global array[5]
gets internally converted to,
global array[]=new int[5]


marksibly(Posted 2005) [#4]

So am I supposed to assume that the line,
global array[5]
gets internally converted to,
global array[]=new int[5]


Yep.

The 'const only' Global initializer stuff will be fixed very soon though!


Curtastic(Posted 2005) [#5]
cool thanks!