List all global variables already assiigned in code

gabriels

2009-10-05 03:38:47

If I could list all variables I've already assigned in my code, it would be much easier to figure out the mess I've made for myself.

Since I'm not so organized, I neglected to keep track of which global variables I have used in my MT code. It wasn't so bad before I learned that the number of variables I could use had expanded beyond ga-gz and g0-g9.

I sorely needed the additional globals and soon started using them, but not being sure which of the original g variables might still be free for use, I added many globals in the h,i,j,k....etc ranges.

Again I wasn't very organized, so now I find myself combing through the code, looking to see which variables I've already used, to make sure I don't really foul myself up by using the same global for 2 different purposes.
Gabriel

florian

2009-10-05 22:53:06

Hi Gabriel,

there is no such function "print all used variables", but what will surely help you a lot is to export the project as a text file (File menu in the current OSX 1.7 beta), or to save preset by preset as a text file (in preset menu, windows and non-beta osx version).

Thanks,
Florian

gabriels

2009-10-06 05:27:22

Florian,
I have done that, and, as you say find it useful, but, first of all, it's quite tedious to print out the presets one by one. I have about 40 presets. Secondly, I have to combine them into one file to make them useful, since one of the things I am trying to do is to debug my code by following along not only in the log file, but also in the text file. It's not at all useful to have the files as individual files per preset since often, variables are used in several presets, and I can't track them unless I combine the text files. Listing all variables instead of all non-zero variables would be a help, but I see that can't be done.
Combining all text files into one does help, but I have to try to keep the text file in sync with the actual code by making changes in the code, and then copying the rules into the text file for the section of my combined file that represents any particular translator I happen to have made changes to.
OK though...I'm sincerely grateful for your immensely useful program.
Gabriel

florian

2009-11-17 12:39:56

Hi Gabriels,

the next version, 1.7.1 due soon, will have the function "Save Project As Text" also in the Windows version. Right now, it's only available in the OSX beta version 1.7.0.

Regards,
Florian

DJ Van Draken

2010-02-16 18:05:22

The original poster's suggestion is a good one. It is a pain to go outside of the software and separately search for each variable that's been used.
Since we cannot make up our own names for variables until V2.0 (which is a much-needed update), we should at least see which global variables are available. I am editing a preset for my SCS.3 System, and it is such a pain to figure out which variables weren't used by the original writer. Almost all of them have been used it seems, but there is no easy way of telling.
Please add a function that lists available global variables.

The code would just be a loop through each variable name (since you can count all 0-290ish of them). For each iteration, it'd just check each variable to see if it's been assigned somewhere. I believe this could be combined with whatever else you have planned in your next update.