Jump to content
Macro Express Forums

Line Numbers


Derfel

Recommended Posts

Derfel,

 

I don't know about the answer to your question... but I do have a suggestion. When I first started writing Macros back in feb... I was writing them long like you. In fact, I copied the commands from the scripting editor into a text document and printed it... I was looking at 20+ pages of script. Someone made the suggestion to me (which I am now passing to you)... break up your macro in mulitple macros. Us the "Run Macro" command to call each in sequence. Find good breaking points and install them in their own macros. This makes macro management so much easier. I have most of my macros broken up anywhere between 3 times (for short macros) and 15 times (for the really long macros). Beleive me... this has saved my hide multiple times. I have also started implementing common macros... where I have macros that perform similar functions, i have clustered the commands that are generic for about 20 macros I have and put them in 1 set where all 20 can call those functions.

Link to comment
Share on other sites

That's a good idea!

 

My problem is though that my macro's (now 5) are used throughout our department and they're password-protected. I wrote an updater-macro, but I've got some difficulties with that, so sometimes a user needs to import them by hand... I know that's not a valid reason for NOT doing things the right way, but there are soooo many things to do :(

Link to comment
Share on other sites

Derfel,

 

This may or may not be your problem... but I, also, have an updater-marco. Goes through and overwrites the macro file on the network with the updated file. I have had problems with this before as well. I find that to correct this... I have the machine using the file on the network terminate macro express and relaunch. I am not saying that it is pretty... but it works for me.

Link to comment
Share on other sites

I agree with derfel in a way as I too was getting lost easily. But I decided line numbers are useless because as I keep adding and modifying they change. Some of my macros are 5 pages printed and I was having trouble keeping it all straight but then I found a trick. First I started using the remarks to annotate my stuff so just like in programming you keep record of what you are doing when but then I discovered that if you insert a remark and leave it blank it just inserts a blank line for you. So now I often put a single blank line between simple routines and a couple between larger sections after which I have a remark about what the next section is doing. I’ve even seen people who will put 3 remark lines, first and last consisting of 40 or so equal characters to make a visual line and the text in the middle all upper case describing what comes next or whatever. Since I’ve started doing this I’ve not lost my way.

 

I agree with cybercheif also to an extent but I wouldn’t get too carried away with that. Personally I saw that I was often using the same routine in different macros so I started breaking those out into generic subroutines. I started to do as cyberchief said but it tended to cause more problems for me. I found that using the remarks I could quickly and easily keep them separate in one macro file. Also I was I use the find to navigate quickly by searching for something in my remarks like “Section 2” or “Find unique”. Also I try to write my variables used ina section in the remarks so if I want to see where I generated T12 I can simple search for it. I’m sure there are better ways and I will probably find something better in the future but this works for me now.

Link to comment
Share on other sites

We have had so many request for line numbers it is likely that they will be added in a future version of Macro Express.

 

There are a couple of things you can do to make distributing an updated macro file easier. These tips apply to updating the entire file, not just a macro or two inside it. If you need to update individual macros then the best way is to have the user import the macros.

 

First, you may want to try Network Synchronization. Macro Express has the ability to periodically check to see if the macro file has been updated. This is designed to allow a single macro file located on a server somewhere to be shared by several computers running Macro Express. This option is turned off by default because the added complexity of checking for shared network operations can slow down the macros. However, in most cases the speed difference is not noticable. We had to design special macros to measure the difference. You can turn on the Network Synchronization features in Options, Preferences, Network.

 

While Network Synchronization is designed to support a single macro file, you should be able to turn this on for computers that do not share a macro file to allow you to safely updated the macro file while Macro Express is running.

 

A second approach to updating the macro file is to use two macro files like this:

- Copy the updated macro file to a temporary file on the computer.

- Have a macro that detects this temporary file.

- Open an updater macro file that runs a macro to do the next 3 steps:

 

- Rename main macro file with a backup name.

- Rename the temporary file to the main macro name.

- Load the newly updated main macro file.

Link to comment
Share on other sites

Kevin,

 

With regards to your note about synchronization:

 

I have a single, centrally located macro file that 30+ users access when they log on to the network. A shortcut in their start up folder automatically loads the macro file.

 

Is there a reason why I would not want to continue supplying the users with the macros in this manner vs. distributing the macro file to each of their PC's? This seems to work well.

 

When I have updates, I copy my "development" version of the macro file over the "production" version and the next time the users log on they get the new macro file and its contents.

 

Appreciate the input.

Link to comment
Share on other sites

The feature to share a macro file works fine and is very convenient in situations like yours. But it will not be reliable unless you enable the Network option File Locking of Macro Files. As a convenience we also suggest that you enable the Automatic Synchronization Update.

 

But, if your network or your server(s) are not reliable and go down from time to time, and if most of the applications used by your users are on their local computers, then you may want to consider having the macro file on each individual computer. This allows the users to continue to work when the network or a server goes down.

 

However, if your network and server(s) are very reliable or if most of the applications used by your users require the network and server(s), then it doesn't matter if the macro file is in a central location. In this senario, if the network goes down, they can't work anyway so it doesn't matter if Macro Express is not working.

 

 

Some of the customers who are updating their macro files using the techniques described previously do not have permanent connection to their server. Some of them are updating their macro file via an FTP file transfer.

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