[Implemented] Flags for ReadCharacter()

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

[Implemented] Flags for ReadCharacter()

Post by AND51 »

Hello!

I need to read 1 letter out of a file. I found no other way, so I request flags for ReadCharacter() by this. My file is always an ASCII file which makes it impossible to compile my program as Unicde at the moment.
If I'm wrong and there IS another way to solve this problem, then don't watch this thread any more and tell me, how to do it.

Greets, AND51
PB 4.30

Code: Select all

onErrorGoto(?Fred)
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

if your file is always plain ASCII, use ReadByte instead of ReadChar... ;)

....and wasn't there a way to change it on the fly, to aplly ASCII on ReadChar even if the program in compiled Unicode?
oh... and have a nice day.
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Post by Demivec »

ReadData(FileNumber, *MemoryBuffer, LengthToRead) would also work. Use PeekS(*MemoryBuffer , Length , #PB_Ascii) to access it.
AND51
Addict
Addict
Posts: 1040
Joined: Sun Oct 15, 2006 8:56 pm
Location: Germany
Contact:

Post by AND51 »

Thank you very, very much for your information :!:
PB 4.30

Code: Select all

onErrorGoto(?Fred)
Post Reply