Equivalent of 'Resources' in .Net


I’n .Net, there is a thing called ‘resources’, that are things you can embed in your .exe. That can be a picture, textfile,…

Is there something equivalent in Xojo? I actually need to store a string within the app, that keeps it value after a restart. It cannot be a constant, because it can change. And writing to a file, database, register, preferences is no option. What should I do?

Thanks in advance!

Why not an option ? That is probably the only way you will be able to save a value between launches. Saving a file in SpecialFolder.ApplicationData is the simplest way to do what you want.

Just drag them into your project in the IDE… then reference them in your code “by name”

dim p as picture

where you dragged a file called “mypicture.jpg” into the ide.

Windows will compile into the EXE … OSX will place it in the APP resource folder…

Works with just about any file type…

Are you saying this can change during program execution then gets written back to the exe ?
Writing to your exe is a non-starter as this is usually flagged as virus like behavior

didn’t see the “it can change part”… that invalidates my suggestion

Old school. Not valid nowadays. Your program can break (fail to rewrite) due to system protection or external antivirus protection. Your embedded resources can be read, but when you need read/write you should export those contents to a proper readable/writable folder on your system as Michael pointed out and read/write from there. Some people ZIP a collection of files and embed the compressed ZIP file in the executable, then unpack those contents in a proper folder on the first run, for example. If you are trying to hide some value, hide it encrypted in one of those external files.