Adding a text file (and many other kinds of files) does not have any influence on the resulting program (the files will not be embedded in the program in any form).
The only difference it makes is that the file is present in the project tree, and if you double click it there it will open in an editor.
This can be handy for many reasons, you could ofor example have a to-do list, or if you have some files that will be used at run time you can manage them in the IDE, …
By the way, the image you have added looks strange (I think it is because it is not publicly accessible).
Maybe the #bininclude compiler directive could help you. By it your text file can be included as a binary. The binary can be converted then to a string.
To demonstrate it take for example main.pro as the text file. It is coded in UTF-8 with a leading byte order mark of 3 bytes. Create a new console application project and replace the code in main.pro by
implement main
constants
text8 :string8= uncheckedConvert(string8,#bininclude(@"main.pro")).
clauses
run():-Str8= string8::fromPosition(text8,3),%remove BOMStr= string8::fromUtf8(Str8),%convert to UTF-16
stdIO::write(Str).
end implement main
goal
console::runUtf8(main::run).
implement main
constants
text8_bin :binary=#bininclude(@"main.pro").
clauses
run():-Len= binary::getSize(text8_bin),Text8= uncheckedConvert(string8, text8_bin),Str8= string8::fromPosition(Text8,3),%remove BOMStr= string8::fromUtf8(Str8,Len-3),% convert to UTF-16
stdio::write(Str).
end implement main
OK, I had forgotten that we add such a null-character, so your version is fine.
Actually, we discussed this quite recently in the team and considered adding a null-char after a #bininclude, so we must all have forgotten that such one is already added . Anyways, we decided that #stringinclude would be a better feature .
I use an interface (.i) file tor embed large strings in an application. The string constant syntax7z is globally visible throughout the application. A rudimentary example is below.
interface aTest
open core
constants
syntax7z :string="Usage: 7z <command> [<switches>...] <archive_name> [<file_names>...]
<Commands>
a : Add files to archive
b : Benchmark
d : Delete files from archive
... etc.
".
end interface aTest