06-07-2023, 02:18 PM
(06-07-2023, 02:09 PM)Kernelpanic Wrote:Correct. If OPTION _EXPLICIT were the first line of code in the example, the variable mm would have been flagged immediately. Also, a constant is not an ordinary variable. A constant can't have its value changed once set. The IDE will flag this if you try it:(06-04-2023, 04:38 PM)TerryRitchie Wrote: I added OPTION _EXPLICIT yesterday to Lesson2: Introducing Variables in the tutorial:@Terry (and @bplus) a constant is just an ordinary variable that can be accidentally changed without the Option Explicit.
https://www.qb64tutorial.com/lesson2
I used Steve's Cheetos example too
From your tutorial:
CONST Foo = 10
Foo = 3
"Expected variable = on line 2"
The IDE does not recognize Foo as a variable because it's been declared as a constant.



![[Image: Terry-Const-ohne-Option-P-07-2023.jpg]](https://i.ibb.co/fH5GQ4G/Terry-Const-ohne-Option-P-07-2023.jpg)