Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
import confusion
#1
I like having my pathfinding code in a seperate file,
BUT the pathfinding code has to use an array from main.bas

I get error message saying
identifier 'UnitExists' is a function, not a var

but really its an array


I could put Dim UnitExists in the pathfinding.bas file

but what if another included file needs to reference UnitExists?

UnitExists needs to be 'global' somehow
Reply
#2
The problem there is that UnitExist must be declared (included) before it's referenced for the 1st time.
Try to put the include at the beginning, and tell me.
Reply
#3
having problems with imports again
please download the project
<!-- m --><a class="postlink" href="http://www.4shared.com/zip/sBALDAkZ/wars.html">http://www.4shared.com/zip/sBALDAkZ/wars.html</a><!-- m -->

and compile wars.bas

it says the function findpath is not found but its in pathfinding.bas

also it says the error is in wars.bas on line 23

but its really in movingfunctions.bas
Reply
#4
Apparently the file pathfind.bas is entirely commented, because it starts with a block comment /' at the beginning.
I tried closing that block comming just before the FindPath funcion declaration and your program was correctly compiled :!:

Included are done by the preprocessor. So you can always try
zxbpp wars.bas and see the resulting souce file, as a first test to discard posible mistakes before going further.

Try removing /' in the pathfinding.bas file and tell me. :roll:
Reply
#5
oh yeh it works now thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)