Fred & Freak, can you please add the same file format flags to ReadCharacter() that are in ReadString()?
I am making my code Unicode friendly, but I need to be able to read ascii and utf-8 files as well, based on the file type.
thanks.
[Implemented] ReadCharacter(#File, [, Flags])
Re: ReadCharacter(#File, [, Flags])
Good idea. In the meantime, you can use ReadString() with a length of 1.
Re: ReadCharacter(#File, [, Flags])
@Fred
With this flag you can remove the functions: ReadUnicodeCharacter() and ReadAsciiCharacter()
Same for WriteCharacter()
And same for PokeC() and PeekC() ?
With this flag you can remove the functions: ReadUnicodeCharacter() and ReadAsciiCharacter()
Same for WriteCharacter()
And same for PokeC() and PeekC() ?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: ReadCharacter(#File, [, Flags])
Thank you. (And if you saw my other post, you will see I am using ReadString, but it is slow compared to readcharacter, which is noticeable in very large files.Fred wrote:Good idea. In the meantime, you can use ReadString() with a length of 1.
As Stargate suggested, perhaps you can implement it in other string and character related commands...where it makes sense, of course. This update will make the elimination of ascii strings significantly easier to deal with.
Last edited by Tenaja on Thu Aug 14, 2014 5:16 pm, edited 1 time in total.
Re: ReadCharacter(#File, [, Flags])
Please don't remove PeekC/PokeC. That breaks macros and requires even more code changes.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: ReadCharacter(#File, [, Flags])
Considering his pattern of previous edits, I think Fred is more likely to change the syntax from this:skywalk wrote:Please don't remove PeekC/PokeC. That breaks macros and requires even more code changes.
PeekC(*MemoryBuffer)
To this:
PeekC(*MemoryBuffer [, Flags])
An edit which will not break existing code.
BTW, I have posted a workaround that does not create a string, by creating a ReadUTF8Character routine. It may or may not be faster; I guess I'd have to benchmark it to tell:
http://purebasic.fr/english/viewtopic.php?f=12&t=60273