Separate files

Just starting out? Need help? Post your questions and find answers here.
Inertially
New User
New User
Posts: 9
Joined: Mon Nov 14, 2011 12:24 am

Separate files

Post by Inertially »

So, other languages have different classes..

Like separating different functions of a program into different files/partitions.

Is there a way to do this in PB?
Is it just the X/IncludeFile call?

What happens with variable scope?
If you include different files into the main project file, can each file have a same-name but separate variable?
User avatar
Shield
Addict
Addict
Posts: 1021
Joined: Fri Jan 21, 2011 8:25 am
Location: 'stralia!
Contact:

Re: Separate files

Post by Shield »

Nope. PB does not support modules, only includes.
The only way to seperate code into different files is to use (X)IncludeFile
and those instructions literally insert the file at the place where the instruction is placed.

If you got global variables in one file they will also be global in every other file you include,
as the scope is shared between the different files.
Image
Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Re: Separate files

Post by citystate »

each Procedure has it's own variable stack, so providing you aren't using globals you should be fine
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
Post Reply