[SOLVED] Assignment between single quotes

Just starting out? Need help? Post your questions and find answers here.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

[SOLVED] Assignment between single quotes

Post 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?
 
Last edited by boddhi on Sat Feb 17, 2024 1:18 pm, edited 1 time in total.
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Assignment between single quotes

Post 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
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Assignment between single quotes

Post 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:
If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
infratec
Always Here
Always Here
Posts: 7662
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: [SOLVED] Assignment between single quotes

Post by infratec »

That's the reason, I would still like to see again "8 bytes" to compare it with a .q
Post Reply