Which indent/unindent strings should be used for automatic indent/unindent and reindent selection for QM Basic?

Which indent/unindent strings should be used for automatic indent/unindent and reindent selection for QM Basic?

2

    Jun 27, 2020#1

    I feel dumb as I can't get the automatic program formatting to work.

    For example, I want and IF statement (in basic) to look like:

    Code: Select all

    IF A OR B THEN
        SSSSS 
    END ELSE
         SSSSS
    END
    ssNext line of code
    What I get is:

    Code: Select all

    IF A OR B THEN
    SSSSS
    END  ELSE
    SSSSS
    END 
    ssNext Line of code
    I am running UES v20.00.0.40.

    My wordfile is attached.
    OpenQm.uew (5.4 KiB)   0

    6,687587
    Grand MasterGrand Master
    6,687587

      Jun 28, 2020#2

      I revised the wordfile and applied following changes:
      1. The line /LanguageMarker = "QM Basic" is removed as being completely invalid. The language markers should be written on first line of the wordfile after the language name. The help page Syntax Highlighting lists all language marker keywords supported by UltraEdit and UEStudio. There should not be a language marker string invented by a user if no supported one matches.
      2. The line with /Delimiters = is moved upwards to be now the second line (not really necessary).
      3. The delimiters are sorted now (not really necessary).
      4. The dot is removed as required to syntax highlight the words defined in the color groups below containing a dot. That modification could be counterproductive. In this case the dot must be added again to the delimiters list. But then all the words with a dot inside must be split up into two words - the string left to the dot and the string right to the dot without or with the dot at beginning. The new word lists must be resorted after splitting them up and words should be removed existing then in more than one color group. The second wordfile in the attached ZIP file is with this modification applied.
      5. A horizontal tab character is added to the list of delimiters which is important because of tabs are used usually in Basic files.
      6. The list of indent and unindent strings is modified to:

        Code: Select all

        /Indent Strings = "BEGIN CASE" "BEGIN TRANSACTION" "DO" "ELSE" "FOR" "LOOP" "THEN" "TRY" "WORK"
        /Unindent Strings = "CATCH" "COMMIT" "END" "NEXT" "REPEAT" "ROLLBACK" "UNTIL" "WHILE"
        There is no need to add the combination of two words like END CASE to indent and/or unindent strings list if one of the two words is already in the list. As a line containing the keyword THEN is interpreted as beginning of a block on which next line should be indented on not containing an unindent string, there is no need to add also IF to the list of indent strings. There was also a double quote missing after TRY.
      7. The case-sensitive interpreted keywords in the color groups are sorted using macro SortLanguage, are checked for duplicate words in the color groups with macro TestForDuplicate with the duplicate words removed and are checked for invalid words with macro TestForInvalid with the invalid words removed which were combination of word delimiters in color group Operators.
      It would be perhaps useful to add also open/close fold strings if you want to use code folding feature, too.
      OpenQm_Wordfiles.zip (5.25 KiB)   0
      ZIP file with wordfile OpenQm.uew improved as described above and with wordfile OpenQm_dot.uew with dot being also a delimiter.
      Best regards from an UC/UE/UES for Windows user from Austria

      2

        Jun 30, 2020#3

        Wow! Thanks for the help!😎