I am very new to Pure Basic. I have knowledge about C, a Little C++ and VB.
I am trying to convert a VB6 Project into PureBasic.
How can I declare a global array of a structure ?
Until now, I couldn't find out.
Thank you for any advice.
Global Array of a structure
Re: Global Array of a structure
Welcome to PB
Is this what you mean ?
http://www.purebasic.com/documentation/ ... tures.html
Code: Select all
Structure MyStruct
field1.i
field2.s
EndStructure
Global Dim MyArray.MyStruct(10)
MyArray(0)\field1 = 0
MyArray(0)\field2 = "Hello"
MyArray(10)\field1 = 10
MyArray(10)\field2 = "Hello again"
http://www.purebasic.com/documentation/ ... tures.html
"Have you tried turning it off and on again ?"
Re: Global Array of a structure
luis wrote:Welcome to PB
Is this what you mean ?Code: Select all
Structure MyStruct field1.i field2.s EndStructure Global Dim MyArray.MyStruct(10) MyArray(0)\field1 = 0 MyArray(0)\field2 = "Hello" MyArray(10)\field1 = 10 MyArray(10)\field2 = "Hello again"
http://www.purebasic.com/documentation/ ... tures.html
Yes, that's it. Thank you

