[ LTS 5.73 X64 Win 10] #PI give a syntax error

Just starting out? Need help? Post your questions and find answers here.
User avatar
bfernhout
Enthusiast
Enthusiast
Posts: 130
Joined: Mon Feb 26, 2018 10:41 pm
Location: Netherlands
Contact:

[ LTS 5.73 X64 Win 10] #PI give a syntax error

Post by bfernhout »

I try to use the constant #PI but the compiler rejects this. By giving a syntax error

Code: Select all

#PI
Then i did somthing realy weerd. And give the constant an value.

Code: Select all

#PI = 3.14
This is also rejected by saying Constant already declared.
Is this a real bug or is there somthing wrong here

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)
From my first self made computer till now I stil like computers.
BarryG
Addict
Addict
Posts: 4210
Joined: Thu Apr 18, 2019 8:17 am

Re: [ LTS 5.73 X64 Win 10] #PI give a syntax error

Post by BarryG »

Not a bug. #PI is a built-in constant that is already defined, so you can't (or need to) re-define it:

Code: Select all

Debug #PI ; Shows 3.1415926535897931
Olli
Addict
Addict
Posts: 1251
Joined: Wed May 27, 2020 12:26 pm

Re: [ LTS 5.73 X64 Win 10] #PI give a syntax error

Post by Olli »

Normally, only #PI like this :

Code: Select all

#PI
should cause an error. Did you test simply this ?

Code: Select all

Debug #PI
User avatar
mk-soft
Always Here
Always Here
Posts: 6291
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: [ LTS 5.73 X64 Win 10] #PI give a syntax error

Post by mk-soft »

#PI is a constant.

Writing only #PI is of course a syntax error. Writing only 100 is also only a syntax error. Where is the problem

Code: Select all

Debug #PI
dblVal.d = #PI
Debug dblval
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
bfernhout
Enthusiast
Enthusiast
Posts: 130
Joined: Mon Feb 26, 2018 10:41 pm
Location: Netherlands
Contact:

Re: [ LTS 5.73 X64 Win 10] #PI give a syntax error

Post by bfernhout »

I did read the documentation on the wrong way. That is becaus i am dyslexis. That give me sometime the wrong impression. After carefully checking and reading the reply i figure it out.

The Constant is already defined. So when i redefine the constant i got a error. When ik defining e.g. #PI its a error cause its already declare with 3.14.... So when i use the #PI the number as a defined constant its working. And i do not need to defining it again.

Thanks for the reply people. Many thanks for the help.
From my first self made computer till now I stil like computers.
Post Reply