![]() |
|
how to #include files with relative path to the current one? - Printable Version +- Boriel Basic Forum (https://forum.boriel.com) +-- Forum: Compilers and Computer Languages (https://forum.boriel.com/forumdisplay.php?fid=12) +--- Forum: ZX Basic Compiler (https://forum.boriel.com/forumdisplay.php?fid=11) +---- Forum: Help & Support (https://forum.boriel.com/forumdisplay.php?fid=16) +---- Thread: how to #include files with relative path to the current one? (/showthread.php?tid=258) |
how to #include files with relative path to the current one? - programandala.net - 2010-06-19 #include <file> includes from the library; in order to include from the directory of the including file, the main program, i tried #include <./file> but it doesn't work. Even #include <~/path_to_the_project/file> doesn't work. The only solution I've found is: #include </home/user/path_to_the_project/file>, that is, including the whole path from the file system root. Is there any way to configure the including directories? It would be great to include files with relative path from the current directory if they exist, and from the library if they don't exist. Re: how to #include files with relative path to the current one? - boriel - 2010-06-19 The standard way (e.g. C compilers) is use angles < ... > for compiler-library files. Use double quotes " ... " for your files. So try: Code: #include "filename.bas"Re: how to #include files with relative path to the current one? - programandala.net - 2010-06-19 boriel Wrote:The standard way (e.g. C compilers) is use angles < ... > for compiler-library files. Use double quotes " ... " for your files. How much distracted I was! Thank you. There is a mention about it in the Library page. An #INCLUDE page is coming
Re: how to #include files with relative path to the current one? - britlion - 2010-06-20 programandala.net Wrote:boriel Wrote:The standard way (e.g. C compilers) is use angles < ... > for compiler-library files. Use double quotes " ... " for your files. I'm glad the library page is being appreciated :-) Perhaps a page on # commands generally, linking to specifics? #include #Pragma, #line, #define #Ifdef.... etc. Re: how to #include files with relative path to the current one? - boriel - 2010-06-20 britlion Wrote:Yes, this goes into the *preprocessor* directives help. The zxbpp preprocessor is called automagically on each file before starting compilation/assembling.programandala.net Wrote:boriel Wrote:The standard way (e.g. C compilers) is use angles < ... > for compiler-library files. Use double quotes " ... " for your files. |