Auto-correct Keywords to UPPERCASE

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
weta
Posts: 4
Joined: Tue Sep 09, 2003 2:53 am
Location: New Zealand

Auto-correct Keywords to UPPERCASE

Post by weta »

Is there any way to have keywords from the Syntax file automatically be converted to uppercase, or at least match the case as shown in the Syntax file?

In other words, as well as colour highlighting as I type, I'd like highlighted words to be changed to be all uppercase.

e.g.

Code: Select all

if v_variable Is null then
    v_variable := 0;
end if;
becomes

Code: Select all

IF v_variable IS NULL THEN
    v_variable := 0;
END IF;
User avatar
webmasta
Posts: 168
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

Could very well burden the program. I would find it more annoying than useful, hate my code littered with uppercase.

Is pressing the shift key too much work?

webM
User avatar
weta
Posts: 4
Joined: Tue Sep 09, 2003 2:53 am
Location: New Zealand

Post by weta »

I don't see how it could burden the program if it's another on/off option. The code is already in there to do the syntax highlighting, it can't be much harder to apply case change as per the syntax file.

As for the shift key, yes, I always use it, but we are upgrading some existing software and are required to conform to a strict set of coding standards. Unfortunately the old code does not conform to these standards very well and different programmers had different coding styles which leads to messy code.

Of course I could use Quest Software Formatter Plus to do the formatting job, but being able to apply the uppercase keywords standard to existing code from within TextPad would be convenient since I do all my editing in TextPad. (UltraEdit can do it but I'm a loyal TextPader....)
User avatar
webmasta
Posts: 168
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

I didnt see anything about on/off option... I saw "automatic",

Obviously if you have running process as you type, memory must be involved to keep trak of each letter, scan the keyword list or keep it in memory, chek the highlight color, check the font, change to upper/lower is required, check if keyword is a string or if its actually in a setting that could be categorized as keyword... bla bla.

Maybe its simpler than this... who knows?

http://www.textpad.com/forum/viewtopic. ... ght=#13009
but being able to apply the uppercase keywords standard to existing code from within TextPad

Try doing that with a macro and ull see the problem helios will face for all the different syntax files.

webM
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

And what will happen if there are two keywords which only differ in their case (and maybe reside in different sections)?

e.g. for Java, it makes a big difference whether you use a boolean or a Boolean (first one is a builtin type, second one is a class).

If I now type BOOlean, will it be converted to Boolean or to boolean?
User avatar
webmasta
Posts: 168
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

Tried learning java back in the early days (teach yourself java in 21 days [purple cover - Laura Lemay]) ..... never got past the first hour... now I know why, thnx to MudGuard :lol:

webM
User avatar
weta
Posts: 4
Joined: Tue Sep 09, 2003 2:53 am
Location: New Zealand

Post by weta »

OK, I said "automatically" but forgot to say anything about switching the feature on or off - I figured that would be obvious since there are lots of ither features that are automatic if you want them to be; e.g. word wrapping, indentation, spell checking, etc

Again, notice I said that the case change could be controlled by the Syntax file - I only want it to be applied when I'm coding Oracle PL/SQL, so I'd only have the 'change case to match Syntax file' option checked for the PL/SQL document class. It would only apply to the document classes you want it to.

Anyway, it sounds like TextPad can't do what I want, so I guess I'll carry one using the Shift key, Formatter Plus and maybe even :shock: :( UltraEdit!
User avatar
webmasta
Posts: 168
Joined: Mon Jul 28, 2003 8:16 pm
Location: Toronto

Post by webmasta »

Take a look at this ( click here )
Thats what I/d like to see in TP...(among other things :wink: )

1. Clickable function list,
2. Expandable variables list that tells me each occurence and the line number,
3. My keywords in bold color (which means if the file is opened in notepad I dont have CAPS all over)
4. And if I feel like it, just collapse the subs by clicking the - button.

Handy little editor that.... but ah luv TP (dunno how much longer, things warming up around here :P )

webM
Post Reply