Instant MQ2DataVar conversion with Textpad

A forum for the general posts relating to MacroQuest. *DEPRECATED: This forum is no longer in public use, but remains here for your reading pleasure. Enjoy

Moderator: MacroQuest Developers

Vexix
Genbot Janitor
Posts: 245
Joined: Sat Apr 17, 2004 10:10 am

Instant MQ2DataVar conversion with Textpad

Post by Vexix » Fri Apr 30, 2004 9:01 am

Sick of searching through your code to replace all those @params with ${param} to convert to the new MQ2DataVars?

If you use TextPad (shareware available - http://www.textpad.com/) for editing your code -- and you should -- you can use the regular expression search and replace function to find every instance of all your @param variables and replace it with ${param}. All of them, no matter what the name. With one mouse click.

Of course, you still have to redo your /declare calls, and your arrays to make them compliant, but at least it saves all that manual labor of just adding } to the end of your variables.

Here's the code:

Use search and replace, and be sure to click on the checkbox for enabling regular expressions.

For the search string, use

Code: Select all

@\([^[:punct:] ]*\)
And for the replace string, use

Code: Select all

${\1}
Voila. All the seagulls you ever wanted.

--Vexix