Unindenting problem with VBScript

Unindenting problem with VBScript

13
Basic UserBasic User
13

    Nov 10, 2006#1

    I find (using VBscript) that if a keyword for 'reindenting' gets inserted part way into a line of code, the auto-reindent happens

    Is this by design, or can I switch if off somehow - example:

    Code: Select all

    on error resume next
    the line isn't part of a loop, and hasn't a 'closer' line, like

    Code: Select all

    with somefunctionname
       .method1
    end with
    is.
    However, it contains the keyword, so gets shifted back one tab, which is really irritating!

    236
    MasterMaster
    236

      Nov 13, 2006#2

      Hi,

      I don't know VBScript, so just for clarity: Which is the keyword that causes "out"denting?

      This is an interesting thread, it nicely complements the threads about false indenting if the indent keyword is somewhere within a line... see Indenting only when a character is at end of prior line?

      Regards,
      Tim

      13
      Basic UserBasic User
      13

        Nov 20, 2006#3

        'next' - from a 'for....next' loop.

        You can see it doing it, by just typing 'on error resume' and the line stays in place, but then add 'next' and it jumps back .

        6,682583
        Grand MasterGrand Master
        6,682583

          Nov 20, 2006#4

          UltraEdit is a general text editor not written for only a certain number of programming languages like Visual Studio. So UltraEdit cannot handle special language dependent exceptions like Visual Studio or other editors written for a specific programming language.

          If you don't want unindentation when you enter the word "next", then remove this word in the wordfile in the line starting with /Unindent Strings = for language /L10"VBScript Active Server Pages".
          Best regards from an UC/UE/UES for Windows user from Austria

          13
          Basic UserBasic User
          13

            Nov 22, 2006#5

            So UltraEdit cannot handle special language dependent exceptions like Visual Studio or other editors written for a specific programming language.
            Kind of surprising that UE can't handle something as basic as only scanning the first word in the line for that - for a general text editor its pretty powerful in all other ways!

            6,682583
            Grand MasterGrand Master
            6,682583

              Nov 22, 2006#6

              Scanning only the first word on a line for an indent / unindent string would maybe the right solution for VBScript, but it is definitively not the right one for 'C'. See following examples:

              Code: Select all

              if(var1) {
                 printf("var1");
              }
              
              if(var2)
              {
                 printf("var2");
              }
              
              if(var3) { printf("var3"); }
              
              if(var4) {
                 printf("var4"); }
              
              if(var5) { printf("var5");
                 printf("\n");
              }
              Indenting on { and unindenting on } should work here in all cases.
              Best regards from an UC/UE/UES for Windows user from Austria

              13
              Basic UserBasic User
              13

                Nov 23, 2006#7

                same principle applies to Perl, but to my mind that's just code layout management?

                Perhaps then some basic rules in a similar vein to regexs?
                'if word x and word y together, don't indent/unindent' ?

                6,682583
                Grand MasterGrand Master
                6,682583

                  Nov 23, 2006#8

                  s_m_b wrote:Perhaps then some basic rules in a similar vein to regexs?
                  'if word x and word y together, don't indent/unindent' ?
                  Maybe you can have this effect when you add word "error" or "resume" to the indent strings.
                  Best regards from an UC/UE/UES for Windows user from Austria