Gobal array?
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Franco.
If you mean GLOBAL... all ARRAYS are always GLOBAL.
Example 1 :
Dim MyArray.l(41)
MyArray(0) = 1
MyArray(1) = 2
Example 2 :
Dim MultiArray.b(NbColumns,NbLines)
MultiArray(10,20) = 10
MultiArray(20,30) = 20
Maybe we should mention it in the helpfile
Have a nice day...
Franco
If you mean GLOBAL... all ARRAYS are always GLOBAL.
Example 1 :
Dim MyArray.l(41)
MyArray(0) = 1
MyArray(1) = 2
Example 2 :
Dim MultiArray.b(NbColumns,NbLines)
MultiArray(10,20) = 10
MultiArray(20,30) = 20
Maybe we should mention it in the helpfile
Have a nice day...
Franco
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by SoulTaker.
The arrays are all global but you can have static arrays witin structures
the DIM keyword is used to resize an array.
Also take a look at shared and protected keywords.
Abit BD7-II Raid P4 1.9 gHz 384 Ram Xtasy GFroce 3 TI 200 CD-RW DirectX 9.0 Beta 3 Sound Blaster Live! XP Pro, Registered PureBasic version 3.40 For Windows.
The arrays are all global but you can have static arrays witin structures
the DIM keyword is used to resize an array.
Also take a look at shared and protected keywords.
Abit BD7-II Raid P4 1.9 gHz 384 Ram Xtasy GFroce 3 TI 200 CD-RW DirectX 9.0 Beta 3 Sound Blaster Live! XP Pro, Registered PureBasic version 3.40 For Windows.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by waffle.
i noticed a sorta bug with PB as reguards to this....
Although a LinkedList is global in scope,
you can't define one in a DLL unless its in some kind of
initialization routine. If you use
NewList MyList.MyType()
outside of a procedure, your DLL will not work correctly.
however, since its use is global, everthing is fine if
its in a DLL startup procedure.
i noticed a sorta bug with PB as reguards to this....
Although a LinkedList is global in scope,
you can't define one in a DLL unless its in some kind of
initialization routine. If you use
NewList MyList.MyType()
outside of a procedure, your DLL will not work correctly.
however, since its use is global, everthing is fine if
its in a DLL startup procedure.
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
BackupUser
- PureBasic Guru

- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm