>Hi all,
>
>I recently upgraded from VFP 7 to 8, & am having a problem with what should be a simple task.
>
>I have a block of code that I want to re-use in all my programs - it sets path, procedure, all my public variables, opens databases, etc. It runs fine as a standalone prog. However, when I include it in other .prg files using #INCLUDE includefile.prg , VFP just doesn't want to run it. I've tried this directive with & without its path, both without success.
>
>Any ideas really appreciated - TIA.
Dan,
I remember trying this in the past. I had no luck either.
According to the help, this is normal behaviour
Only the #DEFINE ... #UNDEF and #IF ... #ENDIF preprocessor directives are recognized in a header file. Comments and Visual FoxPro commands included in a header file are ignored.
You'll have to change
#INCLUDE includefile.prg
into
=includefile()
or
=FunctionNameInIncludefile()
so that the code will execute
Gregory