Macros: A good thing when the situation is right!
Spire_Jeff
Posts: 1,917
I just had an occasion to use the Macros and it saved me a bunch of time! I needed to go through some old code and change it to use a function call to send data to the device instead of send_string. I was able to find replace the send_string dvDevice, and change it to fnSendString(. The problem was that I needed a ) on the end of the statement. I decided to try out the macro functionality because there were a lot of lines and I'm lazy
I started recording. First, I did a find and remembered that someone said it worked better if you just typed in the string to find. I did that, then clicked find. Next I clicked close which left my cursor at the point it found something. I then did END to jump to the end of the line. Lastly I typed ) and finished the recording. I was a little shocked when I hit the play macro button and everything repeated properly! I then got excited and decided I had to post here.
It took a couple months, but I finally found a use for the macros. This is very reliant on being able to determine a definite series of key strokes to accomplish the task tho. It is also dependent on the format of the send_string commands in my case. I would have had to correct things had I split a send_string command over more than one line. The nice thing is that I was able to easily see what was done as I did it one step at a time and I was able to verify the correct changes were made.
Jeff
I started recording. First, I did a find and remembered that someone said it worked better if you just typed in the string to find. I did that, then clicked find. Next I clicked close which left my cursor at the point it found something. I then did END to jump to the end of the line. Lastly I typed ) and finished the recording. I was a little shocked when I hit the play macro button and everything repeated properly! I then got excited and decided I had to post here.
It took a couple months, but I finally found a use for the macros. This is very reliant on being able to determine a definite series of key strokes to accomplish the task tho. It is also dependent on the format of the send_string commands in my case. I would have had to correct things had I split a send_string command over more than one line. The nice thing is that I was able to easily see what was done as I did it one step at a time and I was able to verify the correct changes were made.
Jeff
0