I write to a file opened as:-
OpenFile(#DATNUM, "Name.dat", #PB_Ascii)
character by character using:-
WriteByte(#DATNUM, Asc(aCHAR))
I read it with:-
ReadFile(#DATNUM, "Name.dat", #PB_Ascii)
character by character using:-
aCHAR = Chr(ReadByte(#DATNUM))
Why am I not getting the high ASCIIs as single bytes below 255?
In the following short test extract the 'h' characters have been replaces with chr(209) which should be Ñ but this is how it reads back from the file:-
1 32
2 A 65
3 n 110
4 o 111
5 t 116
6 65489
7 e 101
8 r 114
9 32
10 t 116
11 e 101
12 s 115
13 t 116
14 32
15 65489
16 e 101
17 r 114
18 e 101
19 32
Regard,
1-byte ASCII ?
Re: 1-byte ASCII ?
Use ReadAsciiCharacter instead of ReadByte.
Windows (x64)
Raspberry Pi OS (Arm64)
Raspberry Pi OS (Arm64)
- NicTheQuick
- Addict
- Posts: 1224
- Joined: Sun Jun 22, 2003 7:43 pm
- Location: Germany, Saarbrücken
- Contact:
Re: 1-byte ASCII ?
Byte is signed and Ascii is unsigned.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
Re: 1-byte ASCII ?
Silly me!
Shows how rarely I use Purebasic!
Many thanks to both of you.
Shows how rarely I use Purebasic!
Many thanks to both of you.