Page 1 of 1

Separate files

Posted: Thu Nov 17, 2011 3:47 am
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?

Re: Separate files

Posted: Thu Nov 17, 2011 7:55 am
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.

Re: Separate files

Posted: Tue Nov 22, 2011 12:54 am
by citystate
each Procedure has it's own variable stack, so providing you aren't using globals you should be fine