Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rotate and Scale Mesh Shape
#11
(11-24-2022, 07:19 PM)james2464 Wrote: Nice program...the geometry becomes really interesting.

I don't think I've seen OPTION _EXPLICIT before.   (Maybe I just didn't notice it yet)

After checking the wiki to see what it's about, I don't really understand.   How do I request this for a keyword of the day?  Big Grin

I won't write code without having OPTION _EXPLICIT as my first line of code. As others have pointed out it forces you to declare every variable but I find it handy for another reason as well.

Often times when I'm writing code I'll create lots of variables, or share variables, within my functions and subroutines. As the code progresses some of these variables end up not being used. A quick ' (REM) in front of a declared variable will show if I'm still using it. For example

SUB ThisIsMySUB()

SHARED ThisVariable AS LONG
SHARED ThatVariable AS LONG
DIM AnotherVariable AS INTEGER
DIM YetAnotherVariable AS INTEGER
etc..

When I get close to completing a project and start the process of cleaning the code I can just REM out each SHARED and DIM line individually. The IDE will complain if a variable is in use because OPTION _EXPLICIT is the first line of code. If the IDE complains I know the variable is in use, if no complaints I can safely remove the declaration.

Also, OPTION _EXPLICIT removes the possibility of typos in variable names, the source of many, MANY, a sleepless night debugging.

I highly suggest always using OPTION _EXPLICIT as your first line of code. In fact, I wish the IDE had an option to enable this feature permanently.
Reply


Messages In This Thread
Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 03:07 AM
RE: Rotate and Scale Mesh Shape - by bplus - 11-24-2022, 03:16 AM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 04:14 PM
RE: Rotate and Scale Mesh Shape - by SMcNeill - 11-24-2022, 04:37 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 05:10 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 05:35 PM
RE: Rotate and Scale Mesh Shape - by SMcNeill - 11-25-2022, 06:28 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-24-2022, 06:04 PM
RE: Rotate and Scale Mesh Shape - by james2464 - 11-24-2022, 07:19 PM
RE: Rotate and Scale Mesh Shape - by TerryRitchie - 11-24-2022, 09:49 PM
RE: Rotate and Scale Mesh Shape - by bplus - 11-24-2022, 08:20 PM
RE: Rotate and Scale Mesh Shape - by james2464 - 11-24-2022, 08:35 PM
RE: Rotate and Scale Mesh Shape - by james2464 - 11-24-2022, 10:05 PM
RE: Rotate and Scale Mesh Shape - by mnrvovrfc - 11-24-2022, 10:45 PM
RE: Rotate and Scale Mesh Shape - by TerryRitchie - 11-24-2022, 11:33 PM
RE: Rotate and Scale Mesh Shape - by mnrvovrfc - 11-25-2022, 12:00 AM
RE: Rotate and Scale Mesh Shape - by SMcNeill - 11-25-2022, 06:40 PM
RE: Rotate and Scale Mesh Shape - by King Mocker - 11-25-2022, 03:41 AM
RE: Rotate and Scale Mesh Shape - by bplus - 11-25-2022, 02:12 PM



Users browsing this thread: 2 Guest(s)