Hi, totally new to FB and I'm learning the syntax.
I cant figure this out - how to include local files, I'm on linux.
/home/xxx/FB/project1/this.bas <----- this has the main file to run
/home/xxx/FB/includes/inc01.bas <------ this is my include file
I tried this but it didnt work:
chdir("../") ' to parent dir
#include curdir+"/includes/inc01.bas"
Help appreciated :)
Newbie question - include local files
-
- Posts: 2
- Joined: Jul 27, 2021 17:45
Re: Newbie question - include local files
Try #include "../includes/foo.bi"
or pass the include path to the compiler with the -I argument.
#include is a known as a pre-processor directive. It's handled before any code is compiled so the effect of chdir() does not happen. Also you can't call any procedures like curdir.
or pass the include path to the compiler with the -I argument.
#include is a known as a pre-processor directive. It's handled before any code is compiled so the effect of chdir() does not happen. Also you can't call any procedures like curdir.
-
- Posts: 2
- Joined: Jul 27, 2021 17:45
Re: Newbie question - include local files
Thank you :)