View previous topic :: View next topic |
Author |
Message |
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Wed Oct 11, 2017 5:13 am Post subject: How to auto remark unused variables? |
|
|
Hello all.
Using IDE version 2.0.8.0.004, the code explorer shows vars not used, but there does not appear to be a way to auto remark them all. Am I missing something? Is there a way? If so how?
Thank you!
Tim
(BASCOM-AVR version : 2.0.8 , Latest : 2.0.7.8 ) |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Wed Oct 11, 2017 10:36 pm Post subject: |
|
|
Why go to the work of creating a variable if you are not going to use it ?
You can certainly have a collection of test variables, to see what is happening while debugging. If you use conditional compile, you can 'switch' them on only when the test code runs. Code: |
Const DebugMe = 1 'set to 0 for no debugging
....
#if DebugMe = 1
dim MyTestVar as single
... 'any others you want
#endif
....'then in your code:
#if DebugMe = 1
MyTestVar = 'whatever you want to get from working variables
print MyTestVar
#endif
|
So the debugging variables are only defined and used when in debugging mode.
This way you can set up quite complex debugging stuff, and switch it in and out as needed, eg by setting the DebugMe constant to a different value for each run _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Wed Oct 11, 2017 11:22 pm Post subject: |
|
|
Hi Adrian,
Thank you for your reply. That is not exactly what I am looking for. I used code from a different project that was very near what the new project has to do. However now, in this smaller project, there are tons of vars dimensioned which are not used. The IDE *knows* which are not used (dead they call them) but I was hoping there was a way to automatically remark them out. ie an IDE function.
Thanks again,
Tim |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Thu Oct 12, 2017 5:40 am Post subject: |
|
|
No way to automate it that I know of, but you can at least double-click on the greyed out entry in the code explorer and that jumps you to the DIM statement for that variable. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
TSEYFARTH
Joined: 01 Jul 2006 Posts: 1054
|
Posted: Thu Oct 12, 2017 5:58 am Post subject: |
|
|
Hi Adrian,
I did not know that! It's sure easier than having to find it first!
Thank you!
Tim |
|
Back to top |
|
|
kimmi
Joined: 24 Feb 2006 Posts: 1922 Location: Denmark
|
Posted: Thu Oct 12, 2017 1:35 pm Post subject: |
|
|
The fastest was to find them is CTRL+W scrool down to bottom
here you see unused vars under "Warnings:" _________________ / Kim |
|
Back to top |
|
|
|