Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - 日本語

Change language to:
English - Français - Português - Русский

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

Scilabヘルプ >> Scilab > Control flow > case

case

selectで使用されるキーワード

説明

select ... case ... end命令で使用されるキーワード

キーワードcase は,変数値の1つの値を指します (値の範囲から選択された変数値).

以下のように使用されます:

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

OS=getos()
select OS
case "Windows" then
  disp("Scilab on Windows")
case "Linux" then
  disp("Scilab on Linux")
case "Darwin" then
  disp("Scilab on MacOs")
else
  error("Scilab on Unknown platform")
end

参照

  • select — select キーワード
  • while — while キーワード
  • end — end キーワード
  • for — ループ用の言語キーワード

履歴

VersionDescription
6.0.0 case is now protected: Assignments like case=1 are no longer possible.
Report an issue
<< break Control flow continue >>

Copyright (c) 2022-2024 (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 25 08:53:17 CET 2020