Tapatalk

Indenting BEGIN CASE, CASE, END CASE

Indenting BEGIN CASE, CASE, END CASE

1
NewbieNewbie
1

    Nov 18, 2005#1

    Hi all,

    I'm trying to setup my wordfile to indent the following codes but I can't find the right settings.

    From this:

    Code: Select all

    BEGIN CASE
    CASE X=1
    CALL SOMETHING1
    CASE X=2
    CALL SOMETHING2
    END CASE
    
    To this:

    Code: Select all

    BEGIN CASE
        CASE X=1
            CALL SOMETHING1
        CASE X=2
            CALL SOMETHING2
    END CASE
    
    Now if I reindent this code using the following settings:

    Code: Select all

    /Indent Strings = "BEGIN" "CASE"
    /Unindent Strings = "END" "END CASE"
    
    I get the following:

    Code: Select all

    BEGIN CASE
       CASE X=1
       CALL SOMETHING1
       CASE X=2
       CALL SOMETHING2
    END CASE
    
    Please advise. Many thanks.

    6,685587
    Grand MasterGrand Master
    6,685587

      May 27, 2006#2

      There is no really working solution for this problem. The same problem also exists for the switch statement in 'C'. I think the best solution is to use

      /Indent Strings = "BEGIN" "CASE"
      /Unindent Strings = "END" "CASE"

      and add after BEGIN CASE manually an extra indent with tab key and remove 1 indent also manually before writing END CASE. You should use a template or macro for creating the BEGIN/END CASE block with 2 CASE for writing the code faster.
      Best regards from an UC/UE/UES for Windows user from Austria