The manual is not as up-to-date as the on-line reference. Click on "BASIC Commands" at the top of this forum; select Directives and lookup #include. No mention of it not being currently implemented.NOTE: Reserved for future use. Not currently implemented.
So that last statement suggests there are issues, but if it did work, I'd expect to 'include' it where I wanted the code to be inserted in the main code.
As the compiler processes ’top-to-bottom’ on the pre-processor output file it is necessary to take care to ‘skip’ the #INCLUDE file (if necessary) when it is included at the top of a program.
#include will insert text at that exact point
You saidPS. The other answers missed the question completely. You actually have to read what people write. Nice try.
The literature does say something about its location in pe6.pdf page 21.The literature says nothing about the location of the directive #INCLUDE filename.basinc within a source file.
The quote from pe6.pdf gives one example where it may matter.Does it matter where it is located?
And worth noting that if the include file is in the 'wrong' place you will get an error.The literature does say something about its location in pe6.pdf page 21.
The quote from pe6.pdf gives one example where it may matter.
... As the compiler processes ’top-to-bottom’ on the pre-processor output file it is necessary to take care to ‘skip’ the #INCLUDE file (if necessary) when it is included at the top of a program.
Reset_here: Goto Init #INCLUDE “sphero.basinc” Init:
; jump over include file
; start program here
Actually, you can't always lead a horse to water, and you can make them drink if you can lead them there. I know.And worth noting that if the include file is in the 'wrong' place you will get an error.