Better way to change the string-mode
Posted: Thu Mar 09, 2006 2:25 pm
The new Flag in some functions to change the string-mode is nonpractical (e.g. to set the length=-1 in some functions):
Better way - remove all these new parameters and add a new function like DrawingMode(Mode) or UseBuffer():
For example "StringMode(Mode)" or UseStringSystem(Mode) with the constants:
#PB_Default - Default Mode
#PB_Ascii : Read\Write\Compares the strings as ascii, even when the program is compiled in unicode mode
#PB_UTF8 : Read\Write\Compares the strings as UTF8 (the program can be either in unicode or ascii mode)
#PB_Unicode: Read\Write\Compares the strings as unicode string, even when the program is compiled in ascii mode
So you can set this in the first lines of your code or when you want...
Code: Select all
Result = CompareMemoryString(*String1, *String2 [, Mode [, Length [, Flags]]])
Result = MemoryStringLength(*String [, Flags])
Text$ = PeekS(*MemoryBuffer [, Length [, Flags]])
PokeS(*MemoryBuffer, Text$ [, Length [, Flags]])
Text$ = ReadString(#File [, Flags])
WriteString(#File, Text$ [, Flags])
WriteStringN(#File, Text$ [, Flags])
#PB_Ascii : Read\Write\Compares the strings as ascii, even when the program is compiled in unicode mode
#PB_UTF8 : Read\Write\Compares the strings as UTF8 (the program can be either in unicode or ascii mode)
#PB_Unicode: Read\Write\Compares the strings as unicode string, even when the program is compiled in ascii mode
For example "StringMode(Mode)" or UseStringSystem(Mode) with the constants:
#PB_Default - Default Mode
#PB_Ascii : Read\Write\Compares the strings as ascii, even when the program is compiled in unicode mode
#PB_UTF8 : Read\Write\Compares the strings as UTF8 (the program can be either in unicode or ascii mode)
#PB_Unicode: Read\Write\Compares the strings as unicode string, even when the program is compiled in ascii mode
So you can set this in the first lines of your code or when you want...