Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.1 - English

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

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

Scilab Help >> Scilab > Control flow > resume

resume

return or resume execution and copy some local variables

Calling Sequence

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

Arguments

x1,..,xn

variables in calling environment

a1,..,an

local variables

Description

In a function resume stops the execution of the function, [x1,..,xn]=resume(a1,..,an) stops the execution of the function and put the local variables ai in calling environment under names xi.

In pause mode, it allows to return to lower level [x1,..,xn]=resume(a1,..,an) returns to lower level and put the local variables ai in calling environment under names xi.

In an execstr called by a function [..]=resume(..) stops the execution of the function and put the local variables ai in calling environment under names xi.

resume is equivalent to return.

Note: the usage of this feature can complexify the code. Instead, the syntax function b=foo() is recommended.

Examples

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

foo(42);
assert_checkequal(b,43);
// c does not exist
// with several function calls
function foo1()
  a=1;
  b=2;
  c=3;
  [x,y,z]=resume(a, b, c)
endfunction

function foo2()
  foo1()
  x, y, z // Declared
endfunction

foo2()
// x y z does not exist here

See Also

  • abort — interrupt evaluation.
  • break — keyword to interrupt loops
  • pause — pause mode, invoke keyboard
  • quit — Terminates Scilab or decreases the pause level
  • return — return or resume execution and copy some local variables
  • execstr — execute Scilab code in strings
Report an issue
<< pause Control flow return >>

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:
Thu Oct 02 13:46:44 CEST 2014