Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Xbase DO CASE indention
Message
From
30/01/2013 12:02:33
 
 
To
30/01/2013 11:34:28
General information
Forum:
Humor
Category:
Other
Miscellaneous
Thread ID:
01564657
Message ID:
01564685
Views:
42
>>I propose a new law that says everyone who does not indent the CASE lines in a DO CASE...ENDCASE should be fined $1500 per instance.
>>
>>:-)
>
>Beautify is your friend
>Just sayin'


Some of the code I inherit uses embedded CR/LF in literal strings (via line continuations). Older versions of beautify do not honor that string continuation properly, and subsequently indent everything to where it "thinks" it should be, rather than where it logically should be. This causes issues.
* Original code sample left-justified:
IF .T.
IF .T.
lcTest = "this is a value ;
that continues around TO here"  && Note the quotes start and end on two separate lines
? lcTest
ENDIF
ENDIF

* In VFP9, it correctly indents it, leaving the left-justified string continuation:
IF .T.
    IF .T.
        lcTest = "this is a value ;
that continues around TO here"
        ? lcTest
    ENDIF
ENDIF

* In FPW 2.6, it does not, and indents the continuation line:
IF .T.
    IF .T.
        lcTest = "this is a value ;
            that continues around TO here"
        ? lcTest
    ENDIF
ENDIF
* Several unwanted tabs have just been introduced into the literal string via FPW 2.6's Beautify
* Turning off indented continuation lines makes it even worse.
I'll grant that this is another coding style which should have a fine associated with it... but that's another thread. :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform