Page 1 of 1

'ABCDEFGH' quad sed availability on unicode mode

Posted: Sat Jun 24, 2017 7:02 pm
by Olliv
Now, eight characters quad set are unabled on unicode mode.
We can just type 'ABCD' what is a very limitating type.

Is it possible to truncate natively high 8 bits set and gain this by type 8 characters instead of 4 ?

Re: 'ABCDEFGH' quad sed availability on unicode mode

Posted: Sat Jun 24, 2017 7:37 pm
by Josh
How should this work?

At the moment you can use 4 characters in unicode mode and this is a quad (65536 * 65536 * 65536 * 65535)
Olliv wrote:Is it possible to truncate natively high 8 bits?
No, it's not possible. How would you show e.g. x/u = '€' in this case?


As far as I know, in Java is only one character allowed for character literals and this should be enough.

Re: 'ABCDEFGH' quad sed availability on unicode mode

Posted: Sat Jun 24, 2017 10:55 pm
by Lunasole
Here is some related stuff by Wilbert.
Of course can also use some macro to "pack" quad, but that looks better as for me

Code: Select all

; an example of infinite-lenght ASCII strings in unicode executable
DataSection
  MyStr:
  !db '12345678901234567890123456789012345678901234567890123456789012345678901234567890'
  !db 13, 10
  !db 'ggggggggggggggggggggggggggggggggggggggggggggggggggg'
  !db 0
EndDataSection

Debug PeekS(?MyStr, -1, #PB_Ascii)

Re: 'ABCDEFGH' quad sed availability on unicode mode

Posted: Sun Jun 25, 2017 5:25 am
by wilbert
Lunasole wrote:Of course can also use some macro to "pack" quad
A macro is actually a good idea if you need it for constants.

Code: Select all

CompilerIf #PB_Compiler_Unicode
  Macro _C(c)
    (((c)>>16|(c)>>24&$ffff0000)|((c)|(c)>>8&$ffff))
  EndMacro
CompilerElse
  Macro _C(c)
    (c)
  EndMacro
CompilerEndIf

Macro _C2(ch, cl)
  (_C(ch)<<32|_C(cl))
EndMacro

#Tiff = _C('Tiff')
#Jpeg = _C('Jpeg')
#JpegEnc_ = _C2('Jpeg','Enc_')

Debug Hex(#Tiff)
Debug Hex(#Jpeg)
Debug Hex(#JpegEnc_)

Re: 'ABCDEFGH' quad sed availability on unicode mode

Posted: Fri Jun 30, 2017 1:33 am
by Olliv
After a time of thinking, this wish is too hard to be integrated.

@Josh

That is not exactly the using I did as put a '€' char.
'€' was 'EURO' simply.
I use it to put a readable word\expression as 'BLANC', 'BLEU', 'ROUGE', 'VERT', 'NOIR', etc...

For english\american coders 'WHITE', 'BLACK', 'RED', 'GREEN', 'BLUE', etc...

For german 'WEISS', 'BLAU', 'ROT', etc...

Here I take colours example, but there is x examples or domains. And I limit my example to only 3 languages too.

But if PureBasic Team changed the 'Expr' quotes adding a truncating converter from Unicode to Ascii just inside these specific quotes, I forget how could chinese coders, or japanese coders (limiting my examples to only 2 languages) to code.

Code: Select all

Select Alpha
   Case '蓝'
       BlueSet()
   Case '黑'
       BlackSet()
   Case '绿'
       RedSet()
EndSelect
I doubt my wish would be really fair.

And finally, 'EURO' could be '€' more quickly and others usual symbols too...
:wink: