IncludeBinary?

Just starting out? Need help? Post your questions and find answers here.
CopperCircle
User
User
Posts: 11
Joined: Thu Apr 22, 2004 6:42 pm

IncludeBinary?

Post by CopperCircle »

Hi, is it possible to include a .txt within an exe and then use the ReadString() command to get data from it?
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post by Kale »

Do it like this:

Code: Select all

Debug PeekS(?File)
Debug "String is " + Str(MemoryStringLength(?File)) + " bytes long."

DataSection
    File:
    IncludeBinary "sample.txt"
EndDataSection
Remember about the >64k issue when using strings. If your strings are bigger than 64k you might run into problems, see: viewtopic.php?t=10759
--Kale

Image
Post Reply