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


underscore _

ignored output argument. gettext() alias

Description

The symbol named _ is treated as a special variable used to assign to nothing.

When calling a function or extracting some values, it is sometimes necessary to skip an output argument. If a variable is named _ the output value will not be assigned.

By default and for compatibility, _() is also an alias to gettext().

Examples

// only output commands, the 2nd output argument
[_, commands] = what()

// multiple list assignment is also supported
[a, _, _, d] = list(1,2,3,4)(:)

// this is also available to user-defined functions
function [a, b, c, d]=myFunc()
  a = 1
  b = 2
  c = 3
  d = 4
endfunction

[a, b, _, d] = myFunc()

See also

  • functions — Scilab procedures and Scilab objects
  • names — Naming rules for variables and functions
  • symbols — scilab operator names
  • gettext — indexes or/and translates some indexed english messages
Report an issue
<< tilde Scilab keywords Control flow >>

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:
Mon Jun 17 17:49:14 CEST 2024