Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Option _Explicit Keyword(s) of day XXX:
#3
(06-04-2023, 04:38 PM)TerryRitchie Wrote: I added OPTION _EXPLICIT yesterday to Lesson2: Introducing Variables in the tutorial:

https://www.qb64tutorial.com/lesson2

I used Steve's Cheetos example too Smile

LOL yeah Cheetos is very memorable!

I recommend also while you are DIM your variables, to do them one variable per line at a time and include a commented description.
@TerryRitchie I think you already do this and I remember Walter recommending it as well.

example:
Dim as long i ' a general index for For ..Loop structures in main code

BTW Option _Explicit won't save us from the blunder of using a variable already DIM'd but not the one you intended to use at that particular spot, that would require a truly intelligent AI in the IDE.

This could happen when people use i, ii, iii, iiii... all you have to do is fail to type the proper number of i's.
b = b + ...
Reply


Messages In This Thread
RE: Option _Explicit Keyword(s) of day XXX: - by bplus - 06-04-2023, 04:56 PM



Users browsing this thread: 1 Guest(s)