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

Change language to:
English - Français - 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

Scilabヘルプ >> Scilab > Control flow > return

return

リターンまたは復旧し,ローカルな変数をコピー

呼出し手順

return
[x1,..,xn]=return(a1,..,an)

引数

x1,..,xn

コール側の環境の変数

a1,..,an

ローカル変数

説明

関数の中で, return は 関数の実行を停止し, [..]=return(..) は関数の実行を停止し, ローカルな変数 aiを呼び出し側の環境の 変数 xi に代入します.

pause モードでは,上位レベルにリターンすることができ, [..]=return(..) は上位レベルにリターンし, ローカル変数 aiを呼び出し側の環境の 変数 xi に代入します.

関数からコールされたexecstrの内部では, [..]=return(..)はその関数の実行を停止し, ローカル変数aiを 呼び出し側の環境のxiという名前の変数に代入します.

resumereturnと等価です.

注意: この機能を使用すると,コードが複雑化する可能性があります. 代わりに, function b=foo()構文が推奨されます.

function foo(a)
         a=a+1
         b=resume(a)
         c=52
endfunction

foo(42);
assert_checkequal(b,43)
// c does not exist

参照

  • abort — 評価を中断する.
  • break — ループ中断を表すキーワード
  • execstr — 文字列中のScilabコードを実行
  • resume — リターンまたは復帰実行およびローカル変数をコピー
Report an issue
<< resume Control flow select >>

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:
Wed Apr 01 10:24:57 CEST 2015