Page 1 of 1

PB5.73 LTS #PB_Editor_ProductVersion: wrong value

Posted: Sat Feb 20, 2021 5:04 pm
by Regenduft
I think, #PB_Editor_ProductVersion is sometimes interpreted as a float value and sometimes as a string...

Code: Select all

; Steps to reproduce:
; ---------------------------
;
; 1. open IDE menu "Compiler > Compiler Options..."
;
; 2. Go to tab "Version Info"
;
; 3. activate checkbox "Include Version Information"
;
; 4a. change "Product Version *:" to "1.0" and click OK
;
; 4b. change "Product Version *:" to "1.0.0.0" and click OK
;
; 5. open IDE menu "Compiler > Compile with Debugger"


Debug #PB_Editor_ProductVersion
Debug ""+#PB_Editor_ProductVersion


; Debugoutput with "Product Version *: 1.0" (4a)
;
; [16:55:41] 1.0
; [16:55:41] 1


; Debugoutput with "Product Version *: 1.0.0.0" (4b)
;
; [16:56:11] 1.0.0.0
; [16:56:11] 1.0.0.0

Re: PB5.73 LTS #PB_Editor_ProductVersion: wrong value

Posted: Sun Feb 21, 2021 12:30 am
by breeze4me
One decimal point seem to be treated as a floating point, two or more as a string.
Therefore, it would be better to use the StrF() function to properly display decimal points.

I don't know if it's a bug or not, but I think both cases should be treated as strings.

Code: Select all

a.f = 1.0

Debug a           ;1.0
Debug "" + a      ;1
Debug StrF(a, 1)  ;1.0

Code: Select all

ver.f = #PB_Editor_ProductVersion    ; if "1.0.0.0" is entered in the "Product Version" field, a string error ocurrs. (Trying to write a string into a numerical variable.)

;change "Product Version" to "1.01", the result is "1.01"
Debug #PB_Editor_ProductVersion           ;1.01
Debug ""+#PB_Editor_ProductVersion        ;1.01
Debug StrF(#PB_Editor_ProductVersion, 2)  ;1.01
Debug ver                               ;1.00999999046326