Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.0 - Français

Change language to:
English - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Aide de Scilab >> Scilab > Structure de contrôle > case

case

mot-clé utilisé dans une structure "select"

Description

Mot-clé utilisé dans une structure select ... case ... end

A utiliser de la façon suivante :

select expr0,
case expr1 then
    instructions 1
case expr2 then
    instructions 2
...
case exprn then
    instructions n
[else instructions]
end

Exemples

OS=getos()
select OS
case "Windows" then
  disp("Scilab sur Windows")
case "Linux" then
  disp("Scilab sur Linux")
case "Darwin" then
  disp("Scilab sur Mac OS")
else
  error("Scilab sur plateforme inconnue")
end

Voir aussi

  • select — Mot-clé utilisé dans une structure select-case-else
  • while — mot-clé utilisé dans une structure while ... end
  • end — mot-clé end
  • for — Mot-clé pour les structures de boucles
Report an issue
<< break Structure de contrôle continue >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Tue Feb 14 15:06:28 CET 2017