Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Xbase DO CASE indention
Message
Information générale
Forum:
Humor
Catégorie:
Autre
Divers
Thread ID:
01564657
Message ID:
01564778
Vues:
35
>That's how I tested it, though my top test was OS() = "5". :-) Very difficult to debug. A cursory glance and you're thinking you've just learned that ELSE and OTHERWISE are interchangeable.
>
>In the VXB++ Visual FreePro xbase language I've added two extensions to DO CASE code paths. The first will always execute a block of code before it enters any CASE condition. The second will always execute a block of code afterward if it entered any CASE condition.
>
>
DO CASE
>    ALWAYS BEFORE
>        * Code to execute if someCondition1, or someCondition2 match, before those code blocks are run
>
>    CASE someCondition1
>        * Code for this case condition here
>
>    CASE someCondition1
>        * Code for this case condition here
>
>    OTHERWISE
>        * Code to execute if neither conditions were true
>
>    ALWAYS AFTER
>        * Code to execute if someCondition1, or someCondition2 match, before those code blocks are run
>ENDCASE
>
>In the above, if someCondition1 was true, the sequence would be:
>(1) ALWAYS BEFORE code block
>(2) the CASE someCondition1 code block
>(3) the ALWAYS AFTER code block
>(4) exit the DO CASE
>
>If neither was true, the sequence would be:
>(1) OTHERWISE code block
>(2) exit the DO CASE
>
>I've also added a conditional clause on entry into the DO CASE, which is like:
>
DO CASE someCond
>ENDCASE
>
>Which is like:
>
IF someCond
>    DO CASE
>    ENDCASE
>ENDIF
I like the last one, the Allways{BEFORE|AFTER} not sure, it is like the FINALLY in a TRY catch, till today I do not understand why it's needed.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform