START/STARTENV/STARTCODE
START
compiles the code, and adds that files ending environment to this one.
STARTCODE
only compiles the code, and does not add the file's environment to this one.
STARTENV
only gives the ending environment, and does not give the compiled code.
Syntax
<START|STARTCODE|STARTENV> <filePath>
All imported files are expected to have the .dkls
extension. When importing, you don't need
to include the extension in the name.
- START
- STARTCODE
- STARTENV
File we want to include.
REM My file name is greetings.dkls!
FUNC goodbye
STRING Goodbye!
STRING Hello World
Script where we START
the referenced file.
START greetings
RUN goodbye
Compiled
STRING Hello World
STRING Goodbye!
Notice both the behavior from the function and the execution of the code after carry over to the final compilation.
File we want to include.
REM My file name is greetings.dkls!
FUNC goodbye
STRING Goodbye!
STRING Hello World
Script where we STARTCODE
the referenced file.
STARTCODE greetings
REM We can't RUN goodbye because STARTCODE does not transfer it.
Compiled
STRING Hello World
In this case the execution of the code after the function transfers, but the environment (in this case the function itself) does not so we can't reference it.
File we want to include.
REM My file name is greetings.dkls!
FUNC goodbye
STRING Goodbye!
STRING Hello World
Script where we STARTENV
the referenced file.
STARTENV greetings
RUN goodbye
REM Here we can RUN goodbye, but STRING Hello World will never run because STARTENV doesn't transfer it.
Compiled
STRING Goodbye!
In this case the environment (in this case the function) transfers and we can call it, however the code after it doesn't transfer and thus doesn't run.
Please checkout the readme section