including text files in built apps
BlitzMax Forums/BlitzMax Beginners Area/including text files in built apps
| ||
is there anyway of doing this? i tried incbin, but i couldn't access the file. cheers charlie |
| ||
this works, from the helpRem IncBinPtr returns a byte pointer to the specified embedded binary file. End Rem Incbin "incbinptr.bmx" Local p:Byte Ptr=IncbinPtr("incbinptr.bmx") Local bytes=IncbinLen("incbinptr.bmx") Local s$=String.FromBytes(p,bytes) Print "StringFromBytes(p,bytes)="+s$ |
| ||
move along, nothing to see in this post... |
| ||
ok, this works for reading the file, but how would i make changes to it once its embedded? |
| ||
ok, this works for reading the file, but how would i make changes to it once its embedded? You can't, the executable is locked while its running, so you can't make any changes to itself... And even if you could, that would probably not be a good idea since many virus scanners have a dim view of running executables modifying themselves on the fly, looks a bit suspicious. If you need to save info, you're going to have to deal with an external file. |
| ||
Ok, thanks very much. cheers Charlie |