Page 1 of 1

[SOLVED] Assignment between single quotes

Posted: Sat Feb 17, 2024 12:46 pm
by boddhi
Hello,

Until PB version 6.01, I used to make some assignments such as :

Code: Select all

a='II'
b='MM'
but since version 6.02, a compiler error message appears: "Numbers between '' are limited to 8 characters" (in French : "Les nombres entre '' sont limités à 8 caractères").
The message refers to characters, not bytes. 🤔

Is this normal?
Note : Of course, I can make the assignments in another way, but why doesn't it work any more?
 

Re: Assignment between single quotes

Posted: Sat Feb 17, 2024 12:55 pm
by infratec
Yes, since 6.xx this is normal.

Reason behind: between '' is one ascii character allowed and not a string.

But I was also a bit confused because I compared sometimes MagicNumbers of file headers with 'PK' (for example)

And you are right, the error message is wrong:

Code: Select all

a = '1234'
a = 'II'
1234 are digits and less than 8 :wink:

It should be:
The value between '' is limited to 8 bit

Re: Assignment between single quotes

Posted: Sat Feb 17, 2024 1:16 pm
by boddhi
infratec wrote: Yes, since 6.xx this is normal.
Reason behind: between '' is one ascii character allowed and not a string.
Thanks for confirming what I suspected.
I had read in the documentation that many compiler bugs had been fixed since 6.02 and I suspected there was a link...
But I was also a bit confused because I compared sometimes MagicNumbers of file headers with 'PK' (for example)
Me too, I used it to read some header string data from binary files. It was very practical ! :mrgreen:

Re: [SOLVED] Assignment between single quotes

Posted: Sat Feb 17, 2024 1:35 pm
by infratec
That's the reason, I would still like to see again "8 bytes" to compare it with a .q