Project

General

Profile

Bug #161

Reindent a nested case get indented wrong

Added by Wil van Antwerpen 11 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Start date:
07/12/2019
Due date:
% Done:

0%


Description

Reported by Jose in forum thread:
https://support.dataaccess.com/Forums/showthread.php?64609-DFRefactor-20190426-Reindent-function-mess-up-my-file

I have seen the following:

Procedure MyProcedure
    Case Begin
        Case (1 = 1)
            Case Begin
                Case (2 = 2)
                    If (3 = 3) Begin
                        Showln "test"
                    End
                    Case Break
            Case End
        Case Break
    Case End
End_Procedure

Is refactored to:
~~~
Procedure MyProcedure
Case Begin
Case (1 = 1)
Case Begin
Case (2 = 2)
If (3 = 3) Begin
Showln "test"
End
Case Break
Case End
Case Break
Case End
End_Procedure
~~~

thread-64609.zip (237 Bytes) Wil van Antwerpen, 07/12/2019 02:05 PM

History

#1 Updated by Wil van Antwerpen 11 months ago

As I cannot edit the report.

This was the result:

Is refactored to:

Procedure MyProcedure
    Case Begin
        Case (1 = 1)
        Case Begin
            Case (2 = 2)
                    If (3 = 3) Begin
                                Showln "test"
                                            End
                                                                            Case Break
        Case End
                                                                        Case Break
    Case End
End_Procedure

#2 Updated by Wil van Antwerpen 6 months ago

This is fixed in SciControlLib library rev. 59

Here's an example of reindented code with the latest logic - after it was reindented.

Object oTest Is a BusinessProcess

    Procedure OnProcess
        String sAnimal sSex sTerm sNoise sCatch sDo

        Case Begin
            Case (sAnimal = "Cat")
                Move ("Meow") to sNoise
                Case Begin
                    Case (sSex="male")
                        Move "tomcat" to sTerm
                        Case Begin
                            Case (sCatch="mouse")
                                Move "eat" to sDo
                                Case Break
                            Case (sCatch="bird")
                                Move "kill" to sDo
                                Case Break
                        Case End
                        Case Break
                    Case (sSex="female")
                        Move "female cat" to sTerm
                        Case Break
                Case End
                Case Break
            Case (sAnimal = "Dog")
                Move ("Arf")  to sNoise
                Case Break
            Case Else
                Move ("") to sNoise
        Case End
    End_Procedure

End_Object

#3 Updated by Wil van Antwerpen 6 months ago

  • Status changed from New to Resolved

Also available in: Atom PDF