PB5.73 LTS #PB_Editor_ProductVersion: wrong value

Post bugreports for the Windows version here
User avatar
Regenduft
Enthusiast
Enthusiast
Posts: 121
Joined: Mon Mar 02, 2009 9:20 pm
Location: Germany

PB5.73 LTS #PB_Editor_ProductVersion: wrong value

Post 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
breeze4me
Enthusiast
Enthusiast
Posts: 511
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: PB5.73 LTS #PB_Editor_ProductVersion: wrong value

Post 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
Post Reply