Hello!
Is there a way of compiling and have files get built-in into the executable?
I am thinking about .txt files and others.
For example:
x3d/header.txt
x3d/footer.txt
To create x3d files, I open both files above and append them at the start and end of my data, but it would be great if I could store them in the executable.
Is it possible?
Thanks!
Include non-images in the executable
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
-
- Enthusiast
- Posts: 334
- Joined: Mon Feb 04, 2013 5:28 pm
Re: Include non-images in the executable
Where is the problem with the fact it's not an image ?
You can do it the same way: IncludeBinary "name.txt"
Then you Peek* or CopyMemory() from the right memory address using a label and read back.
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Include non-images in the executable
Buaaaaaaaaaa... I was looking at the PB help and it doesn't explain how to convert to string an included UTF-8 text fileDontTalkToMe wrote:
Where is the problem with the fact it's not an image ?
You can do it the same way: IncludeBinary "name.txt"
Then you Peek* or CopyMemory() from the right memory address using a label and read back.
It just refers the INCLUDE command but no examples.
Re: Include non-images in the executable
This is what i do for arbitrary binary data.
For Text, you could just use Peeks(?SomeBinaryData).
Code: Select all
DataSection
SomeBinaryData:
IncludeBinary "somedata.bin"
SomeBinaryDataEnd:
Data.l 0
EndDataSection
; to get the size of the data
Size.i = ?SomeBinaryDataEnd - ?SomeBinaryData
Re: Include non-images in the executable
Hello:
Code: Select all
Restore Txt
l.i = MemoryStringLength(?Txt, #PB_UTF8)
Debug l
Debug PeekS(?Txt, l, #PB_UTF8)
DataSection
Txt:
IncludeBinary "ReadMeUTF8"
EndDataSection
;Create a File: "ReadMeUTF8"
;Example-Text:
; Ich bin eine UTF-Text-Datei.
; I am a UTF text file.
; Je suis un fichier texte UTF.
; Ek is 'n UTF-tekslêer.
; Jeg er en UTF-tekstfil.
; 我是一个UTF文本文件。
; Mi estas UTF-dosiero-dosiero.
; Is comhad téacs UTF mé.
; Jestem plikiem tekstowym UTF.
; Jsem textový soubor UTF.
; 私はUTFテキストファイルです。
; Είμαι ένα αρχείο κειμένου UTF.
; Я текстовый файл UTF.
; Ik ben een UTF-tekstbestand.
; Ben bir UTF metin dosyasıyım.
; Ik bin in UTF-teksttriem.
- marcoagpinto
- Addict
- Posts: 940
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: Include non-images in the executable
Thanks, my friends!
Re: Include non-images in the executable
; Ich bin eine UTF-Text-Datei.
; I am a UTF text file.
; Je suis un fichier texte UTF.
; Ek is 'n UTF-tekslêer.
; Jeg er en UTF-tekstfil.
; 我是一个UTF文本文件。
; Mi estas UTF-dosiero-dosiero.
; Is comhad téacs UTF mé.
; Jestem plikiem tekstowym UTF.
; Jsem textový soubor UTF.
; 私はUTFテキストファイルです。
; Είμαι ένα αρχείο κειμένου UTF.
; Я текстовый файл UTF.
; Ik ben een UTF-tekstbestand.
; Ben bir UTF metin dosyasıyım.
; Ik bin in UTF-teksttriem.
; Yo soy un archivo UTF
Little spanish please..
; I am a UTF text file.
; Je suis un fichier texte UTF.
; Ek is 'n UTF-tekslêer.
; Jeg er en UTF-tekstfil.
; 我是一个UTF文本文件。
; Mi estas UTF-dosiero-dosiero.
; Is comhad téacs UTF mé.
; Jestem plikiem tekstowym UTF.
; Jsem textový soubor UTF.
; 私はUTFテキストファイルです。
; Είμαι ένα αρχείο κειμένου UTF.
; Я текстовый файл UTF.
; Ik ben een UTF-tekstbestand.
; Ben bir UTF metin dosyasıyım.
; Ik bin in UTF-teksttriem.
; Yo soy un archivo UTF
Little spanish please..
If translation=Error: reply="Sorry, Im Spanish": Endif