Is there a way to find used/defined variables?

  • Q&A Forum
  • Is there a way to find used/defined variables?
0
0

Hi,

I have already included many local and global variables in my project.
Is there a way to find out which variable is used/defined?
(It’s not that important where exactly it is uses/defined.)
I want to prevent that I accidentally use a variable twice.
(On purpose this is fully ok and I do this.)
Otherwise I will have to create some external list
which contains all presets, translators and variables.
But before I start that, I prefer to ask.

Thanks.

Marked as spam
Posted by (Q&A Forum: 12, Answers: 21)
July 17, 2017 10:39 am
60 views
1
Private answer

I use “Export Project as Text” and then input that text file into the PSPad text editor.  It’s set up for dealing with programming tasks, and allows you to list all occurrences of any text string.  You can then navigate to the location in the project, for each instance of the string.

Marked as spam
Posted by (Q&A Forum: 38, Answers: 176)
July 19, 2017 5:11 am

Wow, great solution. Thanks for contributing!

( at July 19, 2017 6:15 am)
0
Private answer

For local variables, you would have to look within the input, output and rules section of each translator.

Note that if there are two translators that are triggered by the same incoming event, their local variables are shared between these translators. (something I neglected to notice in the documentation)

For global variables, if a variable is set to other than zero,  they will show up with their values is you click “dump variables” in the log window, however there is no other way.

What I usually do for complex projects where there are a number of global variables, I set up a init translator the runs at project opening and within the rules of that translator I set them and document each one with comments (lines beginning with //).  That way any time I need a new variable and want to make sure it isn’t used, I go back to that translator, check what is there, then add and document the new one if I wish.  You can see this in the tutoriral we released yesterday at the link below:

https://youtu.be/A2DJuv1zh-U

Steve

bome@sniz.biz

Bome Independent Programming Specialist and Bome Q&A Moderator.

Marked as spam
Posted by (Q&A Forum: 36, Answers: 2724)
July 17, 2017 3:45 pm