<< try Control flow Configuration >>

Scilab Help >> Scilab > Control flow > while

while

while キーワード

説明

while 構文. "end"で終わる必要があります.

while expr ,instructions,...[,else instructions], end

while expr do instructions,...[,else instructions], end

while expr then instructions,...[,else instructions], end

注意:

Scilabプログラミング言語のコード規約に基づき, 以下が推奨されます:

例えば以下のようにします:

i = 0;
while i<5
    disp(i);
    i = i + 1;
end

以下は推奨されません.

i = 0; while i<5, disp(i), i = i + 1; end
条件付き命令(if while for または select/case)の本文を定義するために使用可能な 文字数は 16 k以下とする必要があります.

e=1; a=1; k=1;
while norm(a-(a+e),1) > %eps,
    e=e/2;
    k=k+1;
end
e,k

参照

履歴

VersionDescription
6.0.0
  • The [,else instructions] syntax is no longer supported.
  • while is now protected: Assignments like while=1 are no longer possible.

Report an issue
<< try Control flow Configuration >>