Simply convert the entire .bas file into DATAs and include it at the end of your program.
Here is a FileToDATA converter:
https://www.qb64.org/forum/index.php?topic=790.msg6907#msg6907
it will also create a ready to use writeback function, which you just need to call given with your desired filename.
BTW - In your described case make sure you convert your .bas file to DATAs before adding the $INCLUDE line at the end which embeds the .bas file DATAs.
But $include includes a file into the the program. _deflate$ compresses a string. In both cases I am not sure that they are usefull for my need. Yes, maybe I can make a file copy of the code and than load the code of the copy into the original code as a string, _deflate it, and finally _inflate it and print it as output in file when the program is run.
Or maybe it is also possible to make a code that read it self, than load it into a string and finally print it as output in another file when the program is run. But in all these cases, a text file at least is need. But at the end, the final user of the program, will have only the EXE file, no code. So, if I make a code that read itself in order to load it into a string, I will finally have an EXE file that, when launched, will try to make the same, but no text file will be present to be read. So, the code need somehow to be nested in itself. As to say that into the program, there must be a string (maybe _deflated) that contains the code and that can be printed in a file as output when the program is run by the EXE file. Furthermore, I suppose that this string containing the code, has to not contain itself, if not the program becomes a Chinese box.
sorry if maybe I didn't understand correctly what you said.