Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2024.0.0 - Русский


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-процедуры и Scilab-объекты
  • names — синтаксис имён в Scilab
  • symbols — названия операторов Scilab'a
  • gettext — индексирует или/и переводит некоторые индексированные сообщения на английском языке
Report an issue
<< тильда Ключевые слова Scilab Управляющая логика >>

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:
Tue Oct 24 14:37:04 CEST 2023