Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский

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

Scilab Help >> Advanced functions > mode


select a mode in an exec-file

Calling Sequence

k = mode()


Used exclusively inside an exec-file or a Scilab function mode(k) allows to change the information displayed during the execution, depending on the value of k:

k = 0

The new variable values are displayed if required (see help on semicolon or comma).

k = -1

The exec-file or Scilab function executes silently (this is the default value for Scilab functions).

k = 2

It is the default value on Scilab prompt.

Please notices that mode(2) does not used at prompt, only in an exec-file or a Scilab function.

k = 1 or k = 3

Each line of instructions is echoed preceded of the prompt (if possible). The new variable values are displayed if required. This is the default for exec-files.

k = 4 or k = 7

The new variable values are displayed if required, each line of instructions is echoed (if possible) and a prompt (>>) is issued after each line waiting for a carriage return.

If the carriage return follows character "p" the execution is paused (see pause).

k > 7

User mode. If you define your own mode, it is recommended to use a value > 100.

Line display is disabled for compiled Scilab function (see comp). By default, Scilab functions are executed using the silent ("-1") mode.

Functions in a function library are executed using "-1" mode.


// copy - paste in Scilab

function example_mode(level_mode)
 a = 3




See Also

  • exec — script file execution
  • execstr — execute Scilab code in strings
  • semicolon — (;) ending expression and row separator
  • comma — (,) comma; instruction, argument separator
  • comp — scilab function compilation
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 13:47:02 CEST 2014