Jump to content
Macro Express Forums

stevecasper

Members
  • Posts

    570
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by stevecasper

  1. Is it impossible to size the If Message display window or to format or justify its text? IOW, none of the facilities available in Text Box Display?

     

    If this is true then I'll formally suggest it as a requested feature.

     

    --

    Terry, East Grinstead, UK

    Hey Terry,

     

    I brought this up a couple of weeks ago in HTML In Dialog Boxes. No response from anybody on the board (not that I blame them... I tend to get long-winded). I was planning on submitting a request, but forgot about it. Thanks for the reminder. I'll gladly add my support for that feature.

  2. Is it possible that the original variable %acctnumber% was defined as other than a text variable, e.g. integer? I've experienced this problem once, where a text variable I expected MEP to create for me was created as an integer. I suspect there's a command somewhere which either handles variables of more than one type, or is simply fooling MEP into creating a new variable of the wrong type.

    Of course, for this to be relevant, you need to have the following settings:

    - Prompt the user to create a variable that is not defined : Unticked

    - Automatically create variables in Script Editor : Ticked

    Thanks Paul, unfortunately, the prompt is enabled, so that doesn't qualify. Additionally, the macro worked fine until just before I posted that thread. It is extremely bizarre.

     

    Should that troublesome variable be Global?

    I don't see why not. When I first built the macro I was using Save/Restore commands to make sure the contents of the variable were available to other macros (note the other macro I mentioned that was also effected by the strange error). Global had to be checked in order for Save/Restore to function at all.

     

    Now that I'm saving to the registry, it shouldn't matter whether it's global or local, the registry shouldn't care one way or another. Unless I'm mistaken, which is possible, I'm far from registry-savvy.

  3. I'm not sure that replacing your clipboard variables with registry values will do much for you. After all, you're still using Clipboard Copy - and a chain is as weak as its weakest link! IMHO, it's that Clipboard Copy command in your penultimate code block that is failing - and you're not checking that it's copied anything to the clipboard (in other words, it's the same old problem).

    Based on what I gave you above, I'd agree with you. However, I noticed the problem when I had built the macro with a more complicated sequence designed to make certain the clipboard was not empty (see this thread: Clipboard Copy Usage Inquiry). I simplified it in this thread simply because it wasn't working in either build, and this one is easier to look at.

     

    I'll keep playing with it... hopefully it'll dawn on me just exactly what I'm doing wrong.

  4. <sigh>

    Panic over. Still intensely confused.

     

    I changed %T[1]% to %TextVariable% and it worked fine. I've now changed it to %AccountNumber% and it is working fine. For some reason %acctnumber% is no longer valid for this macro.

     

    As you can see from the screenshot above, this variable's contents gets written to the registry. I have another macro that reads the information later. That macro was using the same %acctnumber% variable, but it stopped working there, too. It is currently set to %T[1]% and is working fine.

     

    I'm baffled... but at least I found an effective work-around.

  5. Ok... I'm about to panic.

     

    Just now, out of the blue, Macro Express stopped recognizing customized variable names. It's been working fine. I don't know what happened, but suddenly I'm screwed.

     

    I've checked and double-checked my variables list in the various macros involved, all of which have the necessary macros in place. I've changed the personalized variable names to old-school %T[1]% variables and the macros work with that... but this is not pretty...

     

    Anybody have any ideas what could have happened? Something I may have done inadvertently and can be fixed? Please help!

     

    This is the error:

    post-2634-1243370841_thumb.jpg

     

    If I change %acctnumber% to %T[1]% the macro runs fine.

     

    Here is my Variables tab:

    post-2634-1243371015_thumb.jpg

     

    And just in case you think it might be something as simple as trying to put a Text Variable in to an Integer Only command, here is line 29:

    post-2634-1243371194_thumb.jpg

     

    What's really confusing me, is that this isn't happening to all my text variables. Just this one.

  6. I haven't seen your ME Pro post yet. But the OP has now started a thread there, so I'll post my example of concurrent macros there too in a few minutes.

     

    --

    Terry, East Grinstead, UK

    Yeah, it looks like the problem I was having has to do with Saving variables. I've had to rethink just about every aspect of how I use variables for ME Pro. I'm having a lot of fun with it, but it's resulted in a lot of errors and frustrating losses of time. I'm completely re-writing all of my macros that use Save/Variables and starting to use Registry Keys and Values to save variables information. It's a little bit more work on the coding end than "Save All Variables" and "Restore All Variables," and (with very few exceptions - which may be user/PC related) is as reliable as, if not more reliable than Save Variables ever was. Even with the exceptions I mention, it seems more reliable than Save Variables has been in my experience with MEP.

  7. Hi - tried this and it worked fine - but -

     

    how can i change this into "The delay will end at:

     

    mean take the time the delay started + 5 minutes and tell me in a message box the end time

     

    hope i explained it right so everyone can understand :-)

    If I understood you correctly, it is a simple matter of adding a second Date/Time Save command (in this case I'll be saving the current time + 25 minutes

    into the future to %T2%:

     

    Date/Time: Save "h:mm:ss AMPM" into %T1%
    Date/Time: Save "h:mm:ss AMPM" into %T2%
    Text Box Display: Delay Start
    Delay 1500 Seconds
    Text Box Close: Delay Start

    <DT:h:mm:ss AMPMT:01:1:><DT:h:mm:ss AMPMT:02:3:{P00000}{P00000}{P00000}{F00025}><TBOX4:T:3:CenterCenter000278000200:000:Delay StartThe delay started at:
    %T1%
    The delay will end at:
    %T2%><DELAY:1500><TBCLOSE:Delay Start>

  8. Ok experts! You guys have all convinced me to abandon Save/Restore Variables as often as possible replacing them with Read/Write Registry commands.

     

    I played with it all week-end at home and have converted the majority of my macros at work (successfully). I feel pretty good about it all, but I just ran into a bit of a snag.

     

    I've never liked Windows Clipboards (in fact I've never learned how to use them effectively, and am often annoyed by the built-in pop-up showing me just how many clipboards I've used).

     

    So, from the dawn of time (ie when I first started using ME many years ago), I've always used ME and the Save/Restore function for multiple clipboards.

     

    Example Copy Macro:

    Variable Restore: Restore All Variables
    Clipboard Copy
    Delay: .8 seconds
    Variable Set String %cb[1]% from the clipboard contents
    Variable Save: Save Text Variables

    Example Paste Macro

    Variable Restore: Restore Text Variables
    Variable Modify String: Save %cb[1]% to the clipboard
    Clipboard Paste

    Under ME3, I had %T81% through %T90% (Ctrl/Alt+1 through Ctrl/Alt+0) dedicated to these clipboards.

     

    I've decided to change these to Registry Read/Writes.

    Write:

    <CLIPBOARD COPY/>
    <VARIABLE SET STRING Option="\x02" Destination="%cb%"/>
    <WRITE REGISTRY VALUE Key="HKEY_CURRENT_CONFIG\\MEVariables\\Clipboards\\Clipboard001" Destination="%cb%"/>

    Read:

    <READ REGISTRY VALUE Key="HKEY_CURRENT_CONFIG\\MEVariables\\Clipboards\\Clipboard001" Destination="%cb%"/>
    <TEXT TYPE Action="1" Text="%cb%"/>

     

    And I'm having some inconsistent results. Is there a time-factor to consider? From my understanding, the macro should not move from the Read command to the Text Type command until the contents of the Registry value have been set to the destination variable... and yet sometimes (not terribly often, but often enough) the macro runs, Forrest pops up, but nothing gets typed or pasted (I've tried both options). I even added a 1 second delay after the Read value to test the consistency (I couldn't imagine it actually taking a full second to read it, though) and still had problems.

     

    Ironically, I ended up using a basic non-macro "copy and paste" in order to get the code pasted above, since the Registry commands weren't working right.

     

    Any advice on what I might be doing wrong before I finish converting all 10 of my clipboards?

  9. I understand the appeal of running a check to ensure that the clipboard is empty before moving on. But from a practical standpoint, it may be as fast -- and maybe faster -- to add a fixed delay.

    The problem isn't making sure the clipboard is empty, but rather making sure the clipboard is not empty.

     

    Adding a fixed delay is not particularly reliable, unless you use an extensive delay, and then it is not likely to be faster than a .05 second delay repeated until the clipboard registers the copy.

     

    I've used fixed delays, because it's just one line of code, but if the delay is too short, and the application (or computer for that matter) is running at inconsistent speeds, then the macro moves along without the required information stored in the clipboard (and therefore variable set from clipboard contents). If the delay is too long, then we have the problem of the macro appearing to hang, or possibly just not being faster than performing the function manually.

     

    Mostly I'm thinking of making a Feature Request for the Clipboard Copy function to have an option to "Wait until clipboard is not empty", or something along those lines. That would avoid both the need for extensive delays (or unreliable delays) as well as extensive code double-checking the clipboard contents. I just wonder if I'm alone in this desire.

  10. In ME3 I was able to customize my command categories so that they made sense to me, or so that I could put commands that I often used together into the same category. Example: If Variable, Else, Break, End if, all made sense to have in the Variables list.

     

    I'm trying to figure out how to do that in MEP. If Variable especially. But I can't seem to figure it out, and the Help files don't appear to have anything on customization.

     

    The closest thing I've found is "Customize Favorites," (about which I couldn't find anything in the Help files) which isn't very user friendly: you can only select one thing at a time, and double-clicking doesn't send the item over to the Favorites window - forcing WAY too much mouse-moving for somebody who uses macros as much as possible. What's more, you can add a "category folder" to the Favorites window, but it seems to be a folder in "icon" only, as the commands you add to it simply get listed below the folder. There does not appear to be any way to put these commands into the category folder. As a test, I created two different category folders, put several commands under each, and then saved it and went to the Favorite Commands list. The items were all listed underneath, with still no way to put them into their particular category.

     

    Maybe I'm just tired... No, I'm definitely tired, but maybe it's the fatigue that's messing me up. Can somebody shed some light on how I might customize my command categories and have it still look nice and organized?

  11. i play a game in full screen mode and the box that pops up minimizes my game, so i was wondering if there was another way to make the macro continue to repeat until i hit a certain key? i was trying to get it to hit keypad 8,4,2,6 and then when i hit F12 it would stop but when i did attempt to do this i just got the pop up window and it minimized my game :(

    Macro Express does not have a "Repeat Until Key Press" command. The best you can do is to utilize Macro Express's "Abort Macro" function (you can see what it is set to by going to Options > Preferences > Playback - There are some limited options if you don't like the default, but not many).

     

    I'm not sure what pop-up window you're having problems with, but when it comes to the abort macro pop-ups, you can turn them off under Options > Preferences > Miscellaneous > Advanced

     

    Good luck.

  12. I know it's probably already on ISS's mile-long list of bugs to fix, but this is just plain annoying:

     

    This is my multiple choice menu - as small as I can make it and still see all the text.

    post-2634-1243129598_thumb.jpg

     

    If I continue shrinking it horizontally, down to the the size it would be if the Prompt Text didn't start vanishing off to the left, then I not only lose the prompt text, I also lose the bottom-most option!

    post-2634-1243129623_thumb.jpg

     

    Anyway, I know ISS is swamped, and I do appreciate the hard work they do to get these things worked out as quickly as possible. A cynical person might focus on the fact that the product was released full of bugs and the purchasing customer is essentially a paying beta-tester - however, as frustrating as some of these issues are, I still have way too much respect for the ISS folks to compare them to Microsoft very seriously.

  13. I've had some success with reading/writing essential variables into the Registry, especially if there are values I wish to retain between runs of a macro. I've manually created a key specific to my macros [HKEY_CURRENT_USER\MACROS\**Macro.Name**\**Key.Values**] then am able to use the same path to store many of my "important" variables. [i prefer to create the keys and values manually before writing my macro, and not bother MEP with "Create Registry Key/Value" commands.]

     

    Joe Weinpert did a good job explaining the Registry commands in Macro Express Explained, and I started utilizing the Registry with ME3. MEP works the same way, and I haven't had any problems with corrupting the Registry in either ME3 or MEP.

     

     
    Read Registry Value "HKEY_CURRENT_USER\MACROS\Bank\Previous Bank" into %Previous Bank%
    Variable Set String %Current Bank% from title
    If Variable %Previous Bank% Equals "%Current Bank%"
     Macro Stop
    Else
    // Change gears for the new bank.
     Write Registry Value "%Current Bank%" into HKEY_CURRENT_USER\MACROS\Bank\Previous Bank
    End If
    

     

    Still, it's the Registry, so tread lightly. ;)

    Thanks Jim,

     

    This is almost exactly what I've ended up doing, and it seems to be working perfectly!

  14. Hey all. I am curious how many people use a "Clipboard Copy snippet," or any series of commands in conjunction with Clipboard Copy in order to guarantee that the clipboard is acquiring information before the macro moves on.

     

    I know that this has been discussed a little bit in the past, but I am considering making a formal feature request for a Clipboard Copy option keeping the macro from moving on until the clipboard <> "".

     

    In case anybody is wondering, and in case somebody has a smoother way of doing this, here is my simple snippet:

    Clipboard Copy
    Repeat Until %Forever% Does not Equal "%Forever%"
     If Clipboard Equals ""
    Delay: .05 seconds
     Else
    Repeat Exit
     End If
    End Repeat

     

    And here is my complex snippet (for those applications that are highly irregular in their timing):

    Clipboard Copy
    Repeat Start (Repeat 10 times) // Storing counter in %N[1]%
     If Clipboard Equals ""
    Delay: .05 seconds
     Else
    Repeat Exit
     End If
     If Variable %N[1]% Equals "10"
    Repeat Start (Repeat 10 times)
      Clipboard Copy
      If Clipboard Equals ""
    	Delay: .05 seconds
      Else
    	Repeat Exit
      End If
    End Repeat
     End If
    End Repeat

     

    So far I haven't had to build a third tier of "If clipboard is still empty..."

  15. I don't think this will help at all, but nobody else has taken a stab, so here's my response:

     

    Imagine a guy whose idea of climbing a mountain consists of sitting in his Laz-E-Boy with a Dew in one hand, the other hand sifting through the crumbs at the bottom of an all-but-empty bag of potato chips, watching an action movie with a spy/ninja on skiis trying to escape from the badguys (who are, of course, on Ski Doo snow-mobiles), in the alps.

     

    Now imagine a famous mountain climber - one who has scaled all the 8-thousanders a couple of times each.

     

    Now, imagine this experienced climber asking the couch-potato for his opinion about which route is faster, or more enjoyable to climb, South Col or North Col.

     

    I think the couch-potato would be better qualified to answer that question than I would be to answer any Macro Express situations that are giving Cory trouble.

     

    Maybe Floyd is around?

  16. Steve... Your killing me man. Please do me one little favor and just try saving a simple item to the registry and read it back. I guarantee you once you get over your phobia you will slap yourself in the head and thank me. Check out the attached file.

     

    The registry is your friend and is no more dangerous than the file system. In fact they are very analogous with respect to risk. Would you start creating, and deleting files in the c:\windows\system32 folder? No way, danger zone. But if you created your own folder named c:\Temp4Steve you wouldn't be afraid now would you? Same with the registry. The registry is simply a database made up of several hives. Each hive has a separate purpose but to keep life simple for you look at HKLM (HKEY_Local_Machine) and HKCU (HKEY_Current_User). Use HKCU most of the time but if you ever need to save something for all users on one machine consider HKLM. Also if in Vista you might not be able to write to HKLM. There is a Miscellaneous key in the Macro Express 4 key I like to use because I know it will always be there and it's blank. Keep yourself in there and you can do no harm. Remember the registry was developed to replace INI files which is essentially what you're trying to do. It was meant for you, try it out!

     

    Oh, click here and check out the Wiki on the reg, it's a good read. Also I would like to stretch my metaphor above. In the registry you have hives as the top level like HKLM and then under that keys are like directories and values are like files. That's not 100% right but I think it would help you initial understanding.

     

    And there is no way variable save is like the registry. With the reg you can save singular or multiple vars but with the Variable save/restore it's the whole kit and caboodle. Also let's say your user is working away and logs off for the evening, if you use the reg the macro will remember when they start up again. Not something Var Restore will do. Also let's say you have 20 macros that like to remember things from day to day, this is impossible to manage with Variable Save/Restore.

     

    Just give it a shot and if you don't slap your forehead with the realization of all the capabilities in the next coupe of days I'll buy you a beer.

    Cory, Paul, and Jim,

     

    Thank you for being patient with me. I really want to learn this stuff, and I have every intention of thoroughly reading up on this in ME Explained. I'm going to download and test out that .mex you provided, too, Cory, and play with the Registry (safely). I've seen so many threads discussing using the registry that I'm surprised I haven't looked more closely before now.

  17. Otherwise, I cannot see any reason to use Variables Save and Restore in MEP.

    Well, in my case (which is similar to your reason 2).

     

    While Macro A isn't calling Macro B, per se, Macro A does need to access information gathered during it's previous run, and compare it to the information being gathered in its current run.

     

    This, to my mind, is a reason to use Save/Restore (which I have done successfully for years); but it is now coming to my attention that this is not what Save/Restore is intended for and I may need to write the 'previous' information to the computer's registry... which honestly seems dangerous and like over-kill when something as simple as Save/Restore has worked so well for so long.

     

    Picture a red dot in the middle of the screen:

     

    Restore Variables (the first time this macro runs: %Var1% = "" & %Var2% = "")

    Get Pixel Color from the dot location

    Set %var1% to pixel color at dot location (Red).

    If %Var1%(Red) <> %Var2%("")

    __Text Box Display: "Dot has changed colors!"

    Else

    __Macro Stop

    End if

    Set %Var2% to %Var1%

    Save Variables

     

     

    In this example, the next time the macro is run, %Var1% and %Var2% will both equal red. The macro will stop. However, if the dot changes to blue, then %Var1% will no longer = %Var2%, and the text box will display that the "Dot has changed colors!"

     

    It's not complicated, and it has always worked until yesterday. I am surprised that nobody else on the board has thought to use Save/Restore in this fashion, but then I guess I've been using the back-side of an axe to hammer in nails... it mostly works, but it isn't the right tool for the job. In the mean-time, my work-around is to use a sledge-hammer while figuring out how to hold a regular one.

  18. Maybe we users could provide more structured input to ISS Support, to their specification, to establish a more methodical approach.

     

    It would be good to get some communication here occasionally about this from ISS, even if work is on-going.

     

    --

    Terry, East Grinstead, UK

    Hey Terry,

     

    I agree. Mostly when I post a broad and vague error in here, it's because I can't seem to isolate it and I'm hoping that somebody in the forum (whether it's you, Cory, Kevin, or even a brand-new board-poster) has had the same problem and been able to link it to something specific so I can check for the same circumstances in my processes.

     

    If nobody else has had any luck pin-pointing it, either, but they're also having the issue, then maybe we can find a common denominator (such as OS, service pack, or something else entirely), so that we have something firm to provide in the official bug report.

     

    When it's just a random event, and only one person is experiencing it, I imagine the bug is not a MEP issue so much as an incompatibility or instability in a local application completely outside ISS's control.

     

    An example: I work with an application that is really very basic-looking. It's one of those apps that appears to be based on DOS. It's not the easiest program to work with using Macro Express (for various unrelated reasons), but it's a good program if you learn its quirks. I use this program to pull up information on accounts. To access any given page, I have the option of selecting a number from a menu which will take me to the next menu and so on until I finally get to the information I want; or I can simply type in the code for the page I want to be on.

     

    Example: To get to the main "title" page of an account, I would type:<ESC> Menu, 6 <Enter>, 2 <Enter>, 1 <Enter>, account number <Tab>, account type (dda/sav/etc) <Enter>

     

    Alternatively I could simply type: inpt,rfaupr2,,00000000 (where the 0's are the account number)

     

    Much better to learn the simple code, even if it isn't immediately sensible. So I have a macro that takes the account number (already stored in a variable), and pastes the inpt, string into the app. This has worked flawlessly for over a year. Until recently. Suddenly the app no longer likes me to paste information, and so it only works about 60% of the time. I've had to go in and change all the pastes to Simulate Keystrokes. Annoying, but nothing I or ISS can do about it. And nothing my IT department is qualified to do about it, either, I think.

  19. Steve, what Jim says is right on. I had not read it before I posted last. And he makes a good point that you do not need to create keys and values before using them, like directories with a file copy they will be created for you.

     

    One important caveat however is that in some cases you do need to clear recycled variables. I just learned this one. Let's say I set the var %Temp% to "Ted" and then read a registry value that's supposed to contain a name. But in this case the value does not exist. %Temp% is not nulled out but rather remains "Ted".

    Thank you both, Jim and Cory.

     

    I hesitate to touch the Registry, as I'm far from a programmer (and I don't know that I could, even if I knew what I was doing, on my work computer... though maybe this is something I can do without admin rights; I really don't know). But I do have ME Explained, so I'll read through any info I can on how the Registry works with ME and how I might be able to make this function for me.

     

    It look like you are using the Variable Restore to load variables form the previous session. I didn't know this was even possible

    This is what I've always used Save/Restore for. It's what I thought the commands were designed to do (besides porting variables content from one macro to another).

     

    From the ME Help pages: "The Variable Save command saves the values of variables set in the macro to system memory."

     

    Is this not precisely what writing to the Registry does? Saves the content of the variable to the Registry so that on a follow-up run of the macro it would be able to pull the same information as was saved? I imagine saving it to the registry would allow it to still be there after a reboot or a termination of MEP, but still essentially the same content, right?

     

    I never used to have this kind of problem with Save/Restore. I've been using this particular macro for well over a year in ME3. The PreviousBank variable was saved to %T96%, the CurrentBank variable was saved as %T95%. I never once had a problem with the Save/Restore making the comparisons. All I've really done, besides transferring the macro over to MEP is change the names of the variables.

     

    For the time-being (while I research the Registry options), I'm converting my Save Variables command to a Modify Variable > Save to File and my Restore Variables command to a Set Variable from Contents of File. It's not elegant, but it works.

     

    And if I've been misusing Save/Restore (which I may well have been), and it's real purpose was simply for moving the contents from Macro A to Macro B within a sub-macro routine, then I suppose it makes sense that it is no longer a worthwhile command-set, other than for use in un-modified ME3 conversions.

     

    Again, thank you for your valuable input. I'll learn all I can about the registry options and see if I can't do what I've been doing, but via the correct tools.

  20. I think you're on the right track Steve. Something else is wiping out that variable. But beyond that here are my 4 cents.

     

    First 2¢: You never need to use delays to wait for variables to be propagated. MEP will not move forward until the action is complete. IOW no matter how fast things go you can not be to quick in moving forward.

     

    Second 2¢: IMHO with the new variables there is no more need for the variable save/restore commands. That is to say in the way we had been using them for sub-macros and such.

    Thanks Cory, I believe your first 2 cents, and I'm removing the delay (it wasn't helping anyway).

     

    I just ran the macro in question 4 times in a row for the same account (it has a manual run option). The first two times it ran as though there were no contents within %PreviousBank%. The 3rd time it ran fine. The 4th time it failed to find any info in %PreviousBank%. Something is wrong with the Restore Variable function.

     

    As for the second 2 cents: I have finally started to grasp that fact. But I do believe it is necessary for this particular set of macros.

     

    Here's the why:

     

    When New Account Macro runs it needs to compare the bank associated with the freshly loaded account against the bank loaded into my assistant application (attempting to access a Bank 002 account when Bank 001 is loaded results in a crushing headache). The only quick and consistantly reliable (or what used to be reliable) way of doing that is to have whichever bank is loaded into the assistant application stored in a variable.

     

    Here's a dumbed-down version of the macro as it stands (all pertinent commands are shown, actual processes for making the change to the assistant application have been reduced to a "Change Bank" command)

    Macro Start
    Restore Text Variables
    Set Text Variable %CurrentBank% from Title
    If %CurrentBank% = %PreviousBank%
     Macro Stop
    Else
     Activate Assistant Application
     Change Loaded Bank to %CurrentBank%
     Set %PreviousBank% to %CurrentBank%
     Save Text Variables
    End If

     

    The next time I run this macro, the Restore Variables command should put something into %PreviousBank%, whether it's Bank 001 or Bank 002 etc. is not the issue... the problem is that the variable is coming up empty.

     

    It's very inconsistent about it, too. Sometimes there is something there, sometimes there isn't. Even when no other macros are being run between instances of running this macro.

     

    Obviously, I need to build a simpler macro that I can duplicate these results with so that I have something concrete to report to ISS, because this is extremely annoying, and since it's inconsistent, and my actual macro relatively complex (and relies on various internal applications), my exact macro won't help them much.

     

     

     

    EDIT -

    I'm a single straw away from replacing the Save Text Variables with a Save Variable to File command, and replacing the Restore Variables with a Set Variable from File command. I'm sure that will work, but I was under the impression that the Save/Restore function was designed to help avoid such a bother.

     

    Cory, if you have a way to work around the Save/Restore (other than the one I just mentioned) for macros such as the one described above, could you let me in on the secret, please?

  21. It sounds like what you describe is intermittent. Can you make a macro that reproduces the problem reliably?

     

    In the cases where you have a problem had you made any changes to the file recently? Yesterday I documented a bug where in certain circumstances it appears if the cache is not getting refreshed and recent changes are not being realized. I doubt this is it though.

     

    FWIW there are integers and decimals but no "decimal integers". :)

    1. I can't reproduce it at all. It's sooooo intermittent.

    2. I hadn't made any changes to that macro at all.

    3. Decimal integers? If you go back and read my original post you will see that I used the term "decimal variables" ... don't you look silly now ;)

     

    PS - I'm on allergy meds... they loop my brain sometimes (even the non-drowsy kind).

  22. Edited at the top for new-comers:

    If you're having Save/Restore problems (as I was), please read through the helpful information provided by Cory, Jim, and Paul below. Their advice about using Registry Keys has been enlightening and has hopefully put me on the path to success. I'd been changing my Save/Restores to Save variable to file/Set variable from file contents. Which is essentially what Reading/Writing to reg. keys appears to be, but it's more hidden. Assuming I'm doing it right. So far, so good. My computers are still working :) Thanks guys!

     

    I hate to beat them when they're dead... eh, I hate beating them when they're alive. But this sucker just keeps rearing its ugly head. And I know it's probably not the horse's fault, but I just can't seem to wrap my ugly head around this.

     

    I have a variable that I set to, let's say Bank 001 while I'm working on Bank 001. This variable is called %PreviousBank%

     

    When I finish working on Bank 001, my main application automatically starts loading Bank 002.

     

    I have a macro (let's call it New Account Macro )that runs every time a new account enters the main application and it detects which bank that account belongs to and assigns that bank name to the variable %CurrentBank%.

     

    The macro then compares the two variables. If they match, it moves on, finishes loading information so I can do my work. If they do not match, the macro runs a sub-macro which activates an assistant application and changes the bank it is set to from %PreviousBank% to %CurrentBank%. %PreviousBank% simultaneously gets updated with the new bank ID.

     

    The macro works fine, mostly. But occasionally, when New Account Macro runs, it checks %PreviousBank% and finds the variable empty. I've tried adding a delay after the Restore Text Variable command, but that hasn't helped.

     

    All I can figure is that I must be Restoring Text variables at some point in another macro, and then not saving them later, so the data is being lost. Does that sound likely? Is that how the Save/Restore functions are working against me? If so, I should be able to just track down which macros I'm using in between and find the hanging Restore that needs a closing Save... or eliminate the Restore altogether (I've found I just don't need them as much as I used to).

     

    Thanks for any input.

  23. I believe that the command you're using requires an integer variable. If you want to wait for 1/4 second, then you should use 250 milliseconds (also an integer).

    No, I learned the trick of using decimal variables in delays from ME's own sample macros, or possibly from featured macros on the www.macros.com website.

     

    I've used decimals in delays for years. Never had a problem with them. Never had a problem with this particular macro till today, even.

  24. Maybe this has been discussed, but I can't recall and couldn't find anything immediately to address this, so please bear with me.

     

    I have been, very occasionally, experiencing a strange behavior with MEP. I get occasional error messages telling me that a variable "is not defined, or is the wrong variable type." My most recent experience was Line 17 of a particular macro.

     

    Line 17:

    Delay: %D[1]% seconds

     

    What's weird about this is this:

     

    Line 3:

    Variable Set Decimal %D[1]% to .25

     

    Between Lines 3 and 17 are a pair of If/End If statements and a set of Window Activate commands. Nothing that I can see which would upset a Variable Set command. It's as if the macro was in such a hurry that it completely skipped Line 3. I run this particular macro hundreds of times every day, but this is the first time I've gotten this error on this particular macro. I ran it again seconds after it aborted without a problem.

     

    On the surface I'd say this is just a random one-time glitch. But I've had it happen on other macros and not always a decimal variables (I don't use decimal variables very often). And in this case, it's not a huge deal, because it's such a small, simple macro. But if somebody were to have this happen in the middle of a large-scale macro it could upset their process severely.

     

    Has anybody else seen this problem? Does anybody have any recommendations for slowing the macro down or ensuring that the macro actually reads each line?

×
×
  • Create New...