QB64.org Forum
Active Forums => QB64 Discussion => Topic started by: hanness on February 15, 2020, 10:55:52 pm
-
I have a somewhat large program (about 7,000 lines of code). I like to put a comment near the start of the program for each variable describing the purpose of the variable. However, I must admit that there are times where I've gone on extended code writing sprees and neglected to note each variable as I went along.
So here's the question: Is there any kind of trick that I can use to simply print out a list of all the variable names in use in my program?
-
https://www.qb64.org/vwatch/ (https://www.qb64.org/vwatch/)
?
-
Use OPTION _EXPLICIT but you probably don't want to start with 7000 lines already coded.
But O_E forces you to DIM everything at which time you can do your commenting. It will even red line everything not DIM'd until you have every one listed. It must be first line in program and when you get tired of it's restrictive nature comment it out and play catch up later by removing comment when code is worked out or buggy. Bonus, saves you from typo bugs.
-
Thank you both for 2 excellent solutions.