Jump to content
Macro Express Forums

Starting macro from middle of script


Jason Gross
 Share

Recommended Posts

I apologize if this is obvious and something I missed.

 

Is it possible to start a macro from the middle of the script? As I create macros, they fail miserably several times and then I'd like to restart it from where it left off to test the next part.

 

I know you can deactivate parts of the macro, but that's time consuming as I cannot just disable the whole script above where I was.

 

Thanks in advance!

 

Jason

Link to comment
Share on other sites

Jason:

 

Not that I'm aware of...what I do is have the macro I'm designing using the main activiation, say (Alt+2). If I have a problem like you describe I make another macro say (Ctrl+2) then copy the code from the first to the second that I want to test or run. This works well for me and I've built macros with over 57,000 lines of script using this method. The only thing you have to remember is if particluar variables capture infromation previously that you need to populate in different screens, etc. that will run in the second test macro those variables will have to be forced at the beginning of the second macro so the information is there.

 

For example, if I have a macro that copies First and Last name from a spreadsheet...but I want to test how it goes through a different screen or field and it will need to populate the first and last name in that screen, you'd have to put variables at the begining to "force" that information in the variables necessary to do the testing you want.

 

This process has always worked well for me. Good Luck!

 

John

Link to comment
Share on other sites

Another idea:

 

Put a temporary multiple choice menu (Dialog) at the beginning of the macro, and use the result to set a variable like N1=1 or 2 or 3 or ... etc. Or just set the N1 value with a statement at the beginning of the macro, which you change manually as your testing progresses.

 

Then break up your macro into convenient chunks that are only executed based on the value of N1:

If N1 >= 1

do first chunk

End If

If N1 >= 2

do second chunk

End If

If N1 >= 3

do third chunk

End If

If N1 >= 4

do fourth chunk

End If

 

etc.

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...
 Share

×
×
  • Create New...