skywalk wrote:I have needs for simultaneous support of both Ascii and Unicode.
For network and hardware communication I use Ascii.
For gui's I prefer to use Unicode.
But, if I want both, I am forced to deal with manual "memory strings" which is a pain.
Why can't we have?
Code: Select all
Define Ascii$ = "123"
Define Unicode$$ = "123"
The idea is good in general, but your example looks like you used the other PB, where the developers always
added more special type-specifier characters.
% = Integer, & = Long Integer, && = Quad Integers, ? = Byte, ?? = Word, ??? = Double Word, ! = Single Float, # = Double Float, ## = Extended Float, @ = Currency, @@ = Extended Currency
Ugly as hell to read or write "w??? = 12 : f## = 1.02## : q&& = 123" or something like that, so please don't do that to PureBasic!
$ is only a shortcut for .s, so $$ would be a shortcut for .ss?
Compiled in UNICODE mode, default $ and .s are UNICODE, $$ and .ss are ASCII?
Compiled in ASCII mode, default $ and .s are ASCII, $$ and .ss are UNICODE?
.as = ASCII string?
.us = UNICODE string?
$$$ would be UTF8 string? Same as .sss? Better .u8s?

$$$$ could be BSTR type. Same for .ssss.
It needs for sure some more thoughts how to do it correctly and beautiful, too.
So let's talk about it, let the ideas flow!
Beside that feature request:
A start for yourself would be to write some more MemoryString functions, relying on existing PB functions to make your life easier.
Use PokeS, PeekS, CompareMemoryString, MemoryStringLength and everything with #PB_ASCII and #PB_UNICODE and #PB_UTF8
and write some functions for converting, concatenation, comparing mixed memory string types etc.
Something like a StringBuilder for ASCII, UNICODE, and UTF8. So you can build mixed strings in memory more easily, with some
functions for manipulating it.