Read string file from Datasection
Posted: Thu Jan 12, 2023 8:58 pm
I would like to attach a string file name 'test.txt' which have a normal ascii text. This file I want to attach to exe at Datasection.

The code is look like this:
The problem is; the outcome from Read.s is not in Ascii. Look at this outcome.

How can I set to Read.s in ASCII format like in ReadFile() command which has flags option.
#PB_Ascii : all read string operation will use ASCII if not specified otherwise.
#PB_UTF8 : all read string operation will use UTF-8 if not specified otherwise (default).
#PB_Unicode: all read string operation will use Unicode if not specified otherwise.

The code is look like this:
Code: Select all
TextString$ = ""
Restore TextLabel:
Read.s TextString$
MessageRequester("Example","The first embedded text is: " + Chr(10) + TextString$,0)
DataSection
TextLabel:
IncludeBinary "test.txt"
Data.s "" ; Make sure we have a nul to stop the string read
EndDataSection

How can I set to Read.s in ASCII format like in ReadFile() command which has flags option.
#PB_Ascii : all read string operation will use ASCII if not specified otherwise.
#PB_UTF8 : all read string operation will use UTF-8 if not specified otherwise (default).
#PB_Unicode: all read string operation will use Unicode if not specified otherwise.