Hi!
I need to create a file that writes a string.
Would be:
WriteString(#file, Chr(0)+Chr(0)+Chr(0)+Chr(6))
When the file is opened, the result is just "♠"
building in another language, I get " ♠"
But I need to build for the web, and I'm trying to do it in SB.
In PureBasic the result is the same.
I tried to save the file with various encoding types, but nothing.
Does anyone know how to do this?
Chr(0) = nothing? So I have a problem.
Re: Chr(0) = nothing? So I have a problem.
using POKEB
Code: Select all
Procedure Callback(Status, Filename$, File, SizeRead)
Select Status
Case #PB_Status_Saved
; File correctly saved
Case #PB_Status_Error
; File saving has failed
EndSelect
EndProcedure
CreateFile(0, "dataFile.hex", @Callback())
*Buffer = AllocateMemory(4)
PokeB(*Buffer,0,0)
PokeB(*Buffer,1,0)
PokeB(*Buffer,2,0)
PokeB(*Buffer,3,6)
WriteData(0,*Buffer,0,4)
ExportFile(0, "text/plain")
Christos
-
- Posts: 3
- Joined: Mon Nov 08, 2021 2:39 pm
Re: Chr(0) = nothing? So I have a problem.
It works perfectly! A problem eliminated.
Thank you very much for the solution and speed!
Thank you very much for the solution and speed!