It is currently Fri Feb 26, 2021 7:55 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: PB5.73 LTS #PB_Editor_ProductVersion: wrong value
PostPosted: Sat Feb 20, 2021 5:04 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Mon Mar 02, 2009 9:20 pm
Posts: 112
Location: Germany
I think, #PB_Editor_ProductVersion is sometimes interpreted as a float value and sometimes as a string...
Code:
; 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


Top
 Profile  
Reply with quote  
 Post subject: Re: PB5.73 LTS #PB_Editor_ProductVersion: wrong value
PostPosted: Sun Feb 21, 2021 12:30 am 
Offline
Enthusiast
Enthusiast

Joined: Thu Mar 09, 2006 9:24 am
Posts: 304
Location: S. Kor
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:
a.f = 1.0

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


Code:
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


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye