Date: prev next · Thread: first prev next last
2025 Archives by date, by thread · List index


Le 10/09/2025 à 18:19, linux a écrit :
Bonsoir et merci Bernard,

Si j'ai bien compris

*Version ElseIF*

If Condition Then

 Instruction

 ElseIF Condition Then

 Instruction

 ElseIF Condition Then

 Instruction

 Else

 Instruction

End IF
OK

*Version Else IF*

If Condition Then

 Instruction

 Else IF Condition Then

 Instruction

End IF
Ce "end if" finit le second if then

 Else IF Condition Then
Donc, ce else ne correspond à rien.

 Instruction

End IF

 Else

 Instruction

End IF


Les end if sont mal placés.

Il faut penser comme ceci :

If Condition Then
    Instruction
Else

     IF Condition Then
        Instruction

    Else

         IF Condition Then

             Instruction

        end if

    end if

end if


le "else if" n'est qu'un else à l'intérieur d'un if. Il est important de mettre des tabulations pour mieux lire ce qui est écrit (comme il est indispensable de mettre en python). Une écriture sans tabulation, mais avec des accolades, comme ne C, permet aussi de comprendre l'imbrication.

--
Amicalement vOOotre              Troumad Alias Bernard SIAUD
mon site : http://troumad.org : AD&D maths WEB...
Pour la liberté http://www.developpez.net/forums/f17/systemes/linux/ N'envoyez que des documents avec des formats ouverts, comme http://fr.libreoffice.org

--
Envoyez un mail à qa+unsubscribe@fr.libreoffice.org pour vous désinscrire
Les archives de la liste sont disponibles à https://listarchives.libreoffice.org/fr/qa/
Privacy Policy: https://www.documentfoundation.org/privacy

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.