DIMDATA as global

Previous topic - Next topic

Moru

Is it possible to explicitly declare a dimdata array as global?

Schranz0r

#1
Code (glbasic) Select
GLOBAL MyArray[]
DIMDATA MYArray[], 0,1,2,3,4,5,6,7,8,9


Thats it.
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

peterpan

#2
Hi SchranzOr,

DIM is always global !
from this it follows that

DIMDATA MYArray[], 0,1,2,3,4,5,6,7,8,9

Schranz0r

#3
Quote from: peterpan on 2008-Sep-01
Hi SchranzOr,

DIM is always global !
from this it follows that

DIM MyArray[10]
DIMDATA MYArray[], 0,1,2,3,4,5,6,7,8,9

NO!
turn the debuger on, and read the warning:

warning : implicitly created GLOBAL  : MyArray

Thats true, NOW its global, but thats the wrong way!

! PLS ! use (for global):
Code (glbasic) Select
GLOBAL MyArray[]
DIMDATA MYArray[], 0,1,2,3,4,5,6,7,8,9


and local
Code (glbasic) Select
LOCAL MyArray[]
DIMDATA MYArray[], 0,1,2,3,4,5,6,7,8,9
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard

Kitty Hello

edited.
DIMDATA does _not_ need an explicit DIM before. I already know the size, so DIMDATA does DIM + DATA.

Schranz0r

I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard