Array scope problem...

Blitz3D Forums/Blitz3D Beginners Area/Array scope problem...

GregBUG(Posted 2004) [#1]
In my main program module i have definied two array

Dim SinTbl#(359)
Dim CosTbl#(359)
Include "2DFunctions.bb"

from the blitz manual

"Arrays are global, and must be defined in the main program."

but if i use the array SinTbl or CosTbl in a secondary module "2DFunctions.bb" (a secondary file with some function that refer to SinTbl and CosTbl) the compiler give me the error: function SinTbl not found! (same things with CosTbl)

Why? Help Me!!!
(NB. i use BB3D 1.87)

thanks!!!
CIAO!


soja(Posted 2004) [#2]
.


TomToad(Posted 2004) [#3]
Are you sure you're using the same name in both? Maybe you're using SineTbl in one and SinTble in another. I just tested myself and have found that it works just fine. Here's the test I did.
;test.bb

Dim SinTable#(359)
Dim CosTable#(359)
Include "test2.bb"

Print SinTable(10)
Print CosTable(10)

WaitKey()

;test2.bb

For t = 1 To 359
 SinTable(t) = Sin(t)
 CosTable(t) = Cos(t)
Next


Program works as expected.


GregBUG(Posted 2004) [#4]
I think is an IDE BUG... i use Protean IDE...
in the original BB3D IDE all work fine!!!

thanks!


GregBUG(Posted 2004) [#5]
was a my project setting error... sorry

Protean Rulez! as always