It seems to me that there is an error in the help regarding str$ in hexadecimal format or perhaps in the function.
The help manual makes it clear that the [toint] parameter is optional, but if I don't use 1, the result is always zero.
Can you try?
wlog str$(255, "%02X") returns zero and wlog str$(255, "%02X", 1) returns the correct value, FF.
STR$ and hexadecimal format
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: STR$ and hexadecimal format
Hi Fernando,
there are no errors.
The documentation states that, for integers arguments, the "last optional" parameter must be 1 Probably the problem is the interpretation of the word 'optional' (in this case required if you want print integer numbers)
there are no errors.
The documentation states that, for integers arguments, the "last optional" parameter must be 1 Probably the problem is the interpretation of the word 'optional' (in this case required if you want print integer numbers)
You do not have the required permissions to view the files attached to this post.
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
Re: STR$ and hexadecimal format
I understand, Francesco.
The thing is that in my limited English I had interpreted that if the number to be formatted was already an integer, it was not necessary to use it.
But in the example it is clear.
Thank you.
The thing is that in my limited English I had interpreted that if the number to be formatted was already an integer, it was not necessary to use it.
But in the example it is clear.
Thank you.
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: STR$ and hexadecimal format
Maybe someone can propose a text without ambiguity that I can replace in the help.[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Dec 05, 2023 10:10 am I understand, Francesco.
The thing is that in my limited English I had interpreted that if the number to be formatted was already an integer, it was not necessary to use it.
But in the example it is clear.
Thank you.
Any proposal is welcomed
- Fernando Perez
- Posts: 378
- Joined: Mon Feb 15, 2021 10:09 pm
- Location: Santander (Spain)
- Has thanked: 195 times
- Been thanked: 267 times
- cicciocb
- Site Admin
- Posts: 2095
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 450 times
- Been thanked: 1385 times
- Contact:
Re: STR$ and hexadecimal format
In fact all is written in the help but probably is not clear
You do not have the required permissions to view the files attached to this post.
-
- Posts: 146
- Joined: Mon Feb 08, 2021 10:10 pm
- Location: Scotland
- Has thanked: 48 times
- Been thanked: 56 times
Re: STR$ and hexadecimal format
Possibly something like:-
The additional ",1" is required for the number types marked integer in the table below.
The additional ",1" is required for the number types marked integer in the table below.
- Electroguard
- Posts: 886
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 285 times
- Been thanked: 329 times
Re: STR$ and hexadecimal format
Or maybe instead of :
The last optional format ‘toint’, if =1, permits to convert the number in integer format.
Replace with:
when using the format$ option, an optional end ‘toint’ can be used to convert the number to integer format if toint=1.
The last optional format ‘toint’, if =1, permits to convert the number in integer format.
Replace with:
when using the format$ option, an optional end ‘toint’ can be used to convert the number to integer format if toint=1.