Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recording a Macro

Status
Not open for further replies.

Mickbw

Programmer
Joined
Jul 9, 2001
Messages
84
Location
US
Good Evening,

I am trying to record a macro that would replace some existing information in several methods on multiple forms.

1. Copy some keystrokes into the buffer. In this case they are: ((goVariables.

2. I then want to be able to type in the name of the property in my empty class (preferrably being able to select it from the intellisense popup).

3. After that I want to copy in these keystrokes
) + "


4. After that it should go to the end of the line (which will contain a table name) and type ")

I am able to do step one, place a pause from the Tools | Macros Menu for 3 seconds to do step 2 and then do steps 3 & 4.

On playback, the 3 second pause I placed in step 2 happens but I can't select an item from the intellisense or type anything until the pause is over and the rest of the text is tacked on the end of the line.

Is what I am trying to do possible? If so, what am I doing wrong? If it isn't possible is there another way to accomplish what I am attempting.

Sincerely,

Mickbw

 
What's the goal here? Is it just to replace text in the methods of the forms? I think it would be easier to just do a simple Search and Replace, typing in the name of the property directly into the method in each case.



-BP
 
Fox macros aren't like VBA macros - you can't record one and then hack it about. You need to write a short program to do what you want. If you follow Barbara's suggestion in the Command Window you can then copy those commands into a file as the basis for your program.

Geoff Franklin
 
Thanks very much for the replies,

I had a feeling it wouldn't be possible. My problem was that I have a large number of instances of different public variables and pathing statements spread potentially through 50 forms which are where all the methods are located. I wish I could say I only inherited this mess but I continued the travesty when I picked up the code.

I have a program to hack the scx file but I have to make changes on both sides of the variable I am planning on changing so I couldn't really do it. I am resolved to using code references and finding each variable and changing it to the new format but if I could have modified the macro it would have been quicker.

Thanks for the help,

Michael
 
Since you have to stop and type stuff anyway, a global replace may not be that effecient. Why not just create 2 separate macros? Execute the first, do your manual typing, the execute the second.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Don't write off macros too soon. Although it's true that they are not as capable as in VBA, there are a surprising number of ways in which they can be used.

In this particular case, I'd agree with the others who suggested a search and replace. However, for more ideas for using macros, see my article "Use keyboard macros to speed up repetitive actions", at:

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top