Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
the compiler doesnt like it when #include statements are not the first thing in a line
so this will work:
#include
but this will not:
<space> #include
the error message complains about a period or full stop being in the wrong place which is not the right issue.
This may turn someone off the language if they cant solve the problem
Posts: 366
Threads: 186
Joined: Sep 2011
Reputation:
0
btw, about #include, can i only use include on libraries placed at '(installed-directory)/library/' ? would be great if the compiler would check them also on other directories, like from a './library/' where the compilable .bas code is, for a more comfortable use when we create our own libraries, and don't want to mess them with the default ones? or maybe i'm missing some important documented information? what do you all think?
Posts: 806
Threads: 135
Joined: Apr 2009
Reputation:
5
IF you use #include "file.bas" instead of <file.bas> it will look in the same directory as the current basic file, rather than in the library.
Posts: 1,838
Threads: 56
Joined: Aug 2019
Reputation:
25
Notice that all this behavior (the # placement and the "filename.bas" and <filename.bas> includes) is the cpp (C PreProcessor) standard behavior. :wink:
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
I split up my code into 2 files so now I have to include linefile.bas
I tried this:
#include "linefile.bas"
but it says
Error: cannot open "linefile.bas" file.
im sure it is in the same directory as main.bas
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
all lowercase
strangely it works in tommy gun but not in BorIDE
Posts: 615
Threads: 49
Joined: Feb 2009
Reputation:
2
Strange... I tested it in BorIDE and it was working fine, even without the path but in same directory as the main file, it found and included the file without problems.
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
when I ran the command line it said cant open file like with BorIDE,
so..why does it work with tommy gun?
Posts: 282
Threads: 48
Joined: Feb 2011
Reputation:
0
i sent you both files now