Tapatalk

Upper case keywords

Upper case keywords

1
NewbieNewbie
1

    May 17, 2005#1

    Is there a way to force keywords to a specific case. Specifically, I am using SQL and matching braces do not work well unless the case matches (e.g. BEGIN END)

    351
    Basic UserBasic User
    351

      May 18, 2005#2

      Good day, luzzel. I've had consistent results by doing the following:
      - Ensure the commands in the SQL block of your wordfile.txt are in uppercase.
      - Remove any Nocase in the SQL language definition block.
      - In the Syntax Highlighting tab, select the SQL language and enable Auto Correct Keywords.

      There might be another way, but I've not found it.

      1
      NewbieNewbie
      1

        May 31, 2006#3

        I tried that but it does not seem to be working since I upgraded from version 10 to 12.

        6,685587
        Grand MasterGrand Master
        6,685587

          Jun 01, 2006#4

          Auto Correct Keywords works also in v12. But Auto Correct Keywords only correct the keywords while entering it. Existing wrong written keywords are not corrected.
          Best regards from an UC/UE/UES for Windows user from Austria

          19
          Basic UserBasic User
          19

            Jul 19, 2007#5

            My problem with PL/SQL is how to get words changed automatically to upper-case when they don't begin with a space.

            I have inserted the word FIRST into the /C1 STYLE_KEYWORD section under PL/SQL in my WORDFILE.txt file.

            If i type in p_evq_models first (a space before the word 'first') this gets converted to p_evq_models FIRST.

            However, if i type in p_evq_models.first the 'first' stays as it is. The dot. before the word seems to stop the automatic upper-case working. Is there any way around this?

            Thanks

            6,685587
            Grand MasterGrand Master
            6,685587

              Jul 19, 2007#6

              You can add character '.' to /Delimiters =

              But you must know that now a string like p_evq_models.first is interpreted as 3 words as indicated by the 3 colors.

              You should use my macro TestForInvalid to verify, if there are any invalid keyword definitions in the wordfile after adding '.' to the delimiters.
              Best regards from an UC/UE/UES for Windows user from Austria

              19
              Basic UserBasic User
              19

                Jul 20, 2007#7

                Yes I thought about that Mofi and tried it before I posted but it still leaves '.first' in lower-case :(

                6,685587
                Grand MasterGrand Master
                6,685587

                  Jul 20, 2007#8

                  You are right. Please uncheck option Do not auto-complete structure members (items following "." or "->") at Configuration - Editor - Auto-complete and then UltraEdit will not treat everything after a '.' or '>' as structure or class element which should not be automatically corrected.
                  Best regards from an UC/UE/UES for Windows user from Austria

                  25
                  Basic UserBasic User
                  25

                    Jul 20, 2016#9

                    Hi, when editing PL/SQL files, I would like UE to do 2 things for me simultaneously:
                    1. Highlight keywords case independently (thus making old code with lower case keywords easier to read)
                    2. Convert newly typed keywords to upper case (which is our company standard)
                    Is there a way to achieve this?

                    I have found in v22.xx that only one of these is working at one time.

                    Now I have "Auto Correct Keywords" on, but since "Nocase" is in my wordfile, keywords are not converted to uppercase, which is a hassle.
                    Regards from Vienna

                    6,685587
                    Grand MasterGrand Master
                    6,685587

                      Jul 20, 2016#10

                      The keyword Nocase defines case-sensitivity for the language which is used by syntax highlighting and by auto correction. It is not possible to configure case-sensitivity for syntax highlighting different to case-sensitivity for auto correction.

                      What you want is partly possible if the keywords are written either in lower or in upper case, but not mixed or with just first letter in upper case and the other characters in lower case.

                      Remove from the wordfile from first line Nocase to make the syntax language case-sensitive. Then create a copy of the lines with the upper case keywords in each color group and convert the keywords in the copy to lower case. The case-sensitive syntax highlighting language contains now the keywords completely in upper case and completely in lower case. On entering a keyword the first character defines the case for the entire word. The keyword is corrected to completely upper case if the first character is in upper case, otherwise corrected to completely lower case. This is not completely what you want, but perhaps nevertheless useful.

                      Further I suggest to define 2 wordfiles for the language. The first one is case-sensitive with all keywords only in upper case. This wordfile contains File Extensions = with the appropriate file extensions list to automatically apply this wordfile after opening a file with the associated file extension. The second wordfile is also case-sensitive, but contains the keywords in upper case and in lower case (or is alternatively not case-sensitive. This second wordfile contains just File Extensions = without any file extension. The language name of the second wordfile should be also slightly different in comparison to language name in first wordfile.

                      The second wordfile must be manually chosen for an opened file via status bar at bottom of main application window or View as (Highlighting File Type) which is done when the opened file is an old one with all keywords in lower case.

                      In case of you ever want to convert the old code from lower to upper case, see Auto correct an existing file.
                      Best regards from an UC/UE/UES for Windows user from Austria