Dim?

Blitz3D Forums/Blitz3D Beginners Area/Dim?

Boiled Sweets(Posted 2004) [#1]
Hi,

I have weird problem. Here is the problem - I have simplified it here...

I have a main.bb and it in I declare

Dim dave(10)

in mainprog.bb I include subprog.bb

In subprog.bb I have...

dave(1) = 10

The compiler does not like this thinking dave is a function (not an array). It complains

"cannot find function dave".

The help says that dims are global and must be declared in the main program. They are but it does not work.

Any thoughts.?


Ethan3850(Posted 2004) [#2]
Position your include after the Dim in mainprog.bb or move the Dim dave(10) to the first line of subprog.bb


WolRon(Posted 2004) [#3]
Remember, all code is executed from Top to Bottom.
Includes are included as if they were actually typed into the place you insert the Include statement.


Rhyolite(Posted 2004) [#4]
Are you using a non-standard IDE which handles include files for you?? If so, check that the IDE is including your files in the order you expect them to be included (as mentioned above).

Rhy Out