Quick Q on Types

Blitz3D Forums/Blitz3D Beginners Area/Quick Q on Types

9572AD(Posted 2004) [#1]
Are Types always Global or do they have to be declared Global if you want that behaviour?

(And reconfirming Arrays are always Global, yes?)


GfK(Posted 2004) [#2]
Not quite sure what you're asking...

Type MyType
  Field X%, Y%
End Type
You can now create instances of MyType from anywhere in your program.

Var.MyType = New MyType
Var only exists in the main program (or the function in which it was declared).

Global Var.MyType = New MyType
Var can now be used anywhere in your program.

Does this help?

(And reconfirming Arrays are always Global, yes?)
Yup.


9572AD(Posted 2004) [#3]
Yeah, I meant a specific type instance, not a type definition.
So, they are not Global by default. That's all I wnated to know. Thanks!


WolRon(Posted 2004) [#4]
You asked if types are global.
That's like asking if integers are global.

:)


9572AD(Posted 2004) [#5]
Hey, I don't need any help to look like a doofus, you know! :)