Page 1 of 1

keywords + uppercase

Posted: Tue Jun 25, 2002 12:19 pm
by audley
Greetings,

Is there a way to "sweep" through a document and automatically convert to uppercase all those words (i.e. reserved words) that have already been colorized by the syntax file. In other words, I'm looking for some kind of macro I guess that converts, say, all Keywords 1 in a document to uppercase.

I've read the various entries requesting an autocomplete feature and the various responses both for and against. I, for one, don't like tools that wrest control from me -- isn't that why we use Textpad instead of Word.... ;). But I would like some automation when I desire it...

Any suggestions?

Thanks. I appreciate it.

Cheers.

Re: keywords + uppercase

Posted: Wed Jun 26, 2002 2:22 pm
by Roy Beatty
I think you need a "programmable" macro, and TextPad does not have that feature. All I can suggest is perhaps a Perl program hanging off of your TextPad Tool menu that <br>
1) saves any changes<br>
2) opens the relevant syntax file for the file you're editting<br>
3) parses the list of keywords<br>
4) reads in the file you're editting<br>
5) uses regex to upcase any occurrences<br>
6) saves the file (TextPad would then inform you that the file has been changed and offer to re-open the changed version of the file).

HTH,

Roy

Re: keywords + uppercase

Posted: Wed Jun 26, 2002 4:02 pm
by Peter
Thanks, Roy

I think you're right. Writing something like that would be a good exercise.

Thanks for the suggestion.

Cheers,

Peter