News:

Function Finder  Find all the functions within source code files

Main Menu

Multiple pba files in a project.

Started by andrik, January 07, 2007, 06:59:07 AM

Previous topic - Next topic

andrik

Hi,

I'm a bit unclear on the use of more then 1 pba file. In Blitzplus for example you have to include those extra files but in Playbasic this doesn't seem to be the case, so how does one pba file know where to look when it calls a function from another pba file?

Another question, I want to declare some images in one pba file (call it the init pba) and make it available in the main pba.
Now I use the statement:
global l_border      = loadnewimage("images/border.bmp")

But this doesn't seem to work right, It's not global over more than one pba file. So how can I make images global over all pba files?

thanks in advance,
Andrik

empty

The best way to use multiple source files is by using the project manager (Project -> Manage Project). You can add existing pba files or create new ones and put them in the desired order.
There is also an #INCLUDE directive, however, it's mainly used for standard or reusable libraries and those source files are not part of the project.

Currently only function declarations are picked up during stage 1 of the compilation. So all other declarations need to be located before they are used. In your example, make sure that l_border is declared before this variable is used elsewhere in the code.