Jump to content
Macro Express Forums

Display a listing of what I named my variables?


Recommended Posts

Hi,

Is there a way that I can view all of my variable "names" that I have used in all of my macros?

It seems like I should be able to just look them up somewhere here in MEP?

 

I'm thinking that I could keep track of them in a popup text box.... But can I somehow "extract" all the names that I've already used in my previously completed macros? (without having to search through each macro individually?)

 

Thank you in advance for any help.

Doreen

Link to comment
Share on other sites

If you mean list all the variables in multiple macros all at once I do not believe so. There is File > Export > Output Macro Information but it does not include an option for variables. I'm guessing no one ever considered variable names since in the past only because in ME3 we only had three built in vars. I would like to suggest you make a feature request to have an additional option for variables.

 

Having said that I think you could write a macro to create this list. I have written several macros that manipulate the output from the Output Macro Information to do things like listing and substituting all the ME3 type variables and think it would be a trivial matter to create a macro to do something similar for your needs. I would start by exporting the macro information then just start looking for percent signs and create a unique list of every variable. Actually I think it would be fairly simple. Export the name and macro script then plow thru that with a macro by putting it in a variable. Then find the first name and log then find the first percent and delete everything up to it. Now find the next percent and whatever in between is the variable name which you would log. Now just keep going thru that iteratively. Also you could check if you have already logged it and thus eliminate duplicates. If you're interested in doing something like this and are having difficulty doing it let me know and I'd be happy to help hack something out.

Link to comment
Share on other sites

Cory,

Thank you so much. The "Output Macro Information" suggestion was perfect for what I needed. I didn't have too many names that I actually cared about, so I just jumped through the notepad using the "find" and found all the names that I was looking for. I put them in an Excel list now.

 

Another question... Is there a way to view all the names of the "saved variables"? (Like I can when I've saved to an Environment Variable?)

 

*(Someday I'll get up the nerve to learn how to use the registry variables. :) )

 

Thanks again!

Doreen

Link to comment
Share on other sites

*(Someday I'll get up the nerve to learn how to use the registry variables. :) )

It's really not a big deal! The dire warnings that usually accompany some registry tweak are, IMHO, way over the top! Yes, you can make your machine unusable by changing the wrong registry settings, just as you can destroy all your data by passing a magnet over or near your hard disk. And driving a car is pretty dangerous too!

I recommend you create a key in the registry, e.g. HKCU\Doreen (that's HKEY_CURRENT_USER\Doreen in long-hand), and save any new keys and values under that key. Then there's no way you can do any damage.

Link to comment
Share on other sites

Paul,

Thanks so much for telling me exactly where to put them in the registry. That's sorta been a big delimna in my brain. I'm going to re-do my macros. Because I think that the registry is really want I want. I'm tired of using the "Restoring" and "Saving" variables commands.

 

My other concern with using the registry for my variables, is this. Is there ever any "invalid" characters that I might save to a registry variable, that might possibly be really bad for the registry? Examples: "{" "[" "|" "^" ??? Somehow it's in my brain that those could mess something up?

 

Also, can I save an ASCII character to a registry variable? (Example: the TAB?)

 

Yes, I'm a chicken.LOL

 

Doreen

Link to comment
Share on other sites

I save 'non-printing' characters including Tab to the registry all the time with no problem. Just try it, you're not going to frag your machine or anything. Worst case delete the values with RegEdit.

 

We had a discussion awhile back where I poo-poo'd the idea of using variable save/restore and described using the registry in detail. You might want to check it out.

 

I use the reg all the time but I also use INI files in some cases where the setting wants to span multiple machines or users. Using the reg is preferable IMHO but in many cases, especially with distributed macros, it will not suit your needs. I am also into creating macro packages these days. Essentially there is a macro file in a folder and I use that as a container for all the necessary supporting files. Then at the beginning of each macro I get the current macro file name and chop off the name and extension. Now I can have a var like %MEXPath% and now when I want to access a supporting file like CompanyMacro.INI I just have to preface it with %MEXPath%. Now not only is it portable but I can also maintain a development copy which I can roll active when I am ready. Yes there's a macro to do that as well! Usually it asks me for the changes and maintains them in a log along with date stamped versions of all the previous versions. Also creates activate and deactivates several macros and notifies users automatically of a new release via email. Sounds like a lot but it's really simple.

Link to comment
Share on other sites

Cory,

Ok, I'm going to find my Macro Express book and read about the registry commands. That's probably what I really need to use.

In the past, I had tried saving to named environment variables, but it didn't work the way I wanted it to when I saved a variable that was blank. (when I retrieved the environment var, it would only return the actual name of the variable. (example: "%MyVarPhoneNum%"). Is the registry going to do the same thing? or will it actually store the blank value?

 

Also, I played with the INI commands, and that is going to be great for something else that I've been trying to figure out how to do. Which leads me to another question. I'm probably going to end up with about 600 INI files in a folder. My question is this: Is it OK to have a bunch of INI files on my computer? I mean, my computer itself doesn't automatically look for INI files does it? (I'm questioning this because I read your "poo-poo'd" discussion where it explained that the registry is designed to replace INI files.)

 

Thanks again!

Doreen

Link to comment
Share on other sites

Thanks Paul, I'm glad having that many INI files isn't a problem.

 

Basically each INI file will be a "backup" of fields on a particular screen. And I will use the INI files to do a "quick restore" when I need to. (The reason that I even need to occasionally re-enter the same information is an annoying issue that I have no control over.)

Link to comment
Share on other sites

Basically each INI file will be a "backup" of fields on a particular screen. And I will use the INI files to do a "quick restore" when I need to. (The reason that I even need to occasionally re-enter the same information is an annoying issue that I have no control over.)
You might be missunderstanding how INI files work. I would hazard a guess that you could probably save all that data in one INI file.
Link to comment
Share on other sites

OMG.. I'm an idiot...
Sometimes it's the obvious things that escape us. But I challenge you to think once again. Not only do you have sections but you have values too. EG if you had 600 settings to save you would most likely have about 30 sections each with an average of 20 values. This way you might have the values "X" and "Y" appearing several times under different sections.

 

This brings me to another shortfall of INI files. I often want a deeper organization structure than this affords and that's another place where the registry is much nicer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...