Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.1 - Português

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

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

Ajuda do Scilab >> Funções > funcprot

funcprot

alterna o modo de proteção de funções Scilab

Seqüência de Chamamento

funcprot(prot)
previousprot = funcprot(prot)
prot = funcprot()

Parâmetros

prot

inteiro com valores possíveis 0,1 ou 2

Descrição

Funções Scilab são variáveis, funcprot permite especificar o que o Scilab faz quando tais variáveis são redefinidas.

  • Se prot==0 nada especial é feito

  • Se prot==1 o Scilab exibe uma mensagem de aviso quando a função é redefinida (modo padrão)

  • Se prot==2 o Scilab exibe uma mensagem de erro quando a função é redefinida

Exemplos

previousprot = funcprot(1)
deff('x = foo(a)','x = a;')
deff('x = foo(a)','x = a + 1;')
foo = 33
funcprot(0)
deff('x = foo(a)', 'x = a;')
deff('x = foo(a)', 'x = a + 1;')
foo = 33
funcprot(previousprot)

Ver também

  • predef — proteção de variáveis

History

VersãoDescrição
5.4.0 Previous value is returned as output argument when setting a new value.
Report an issue
<< feval Funções function >>

Copyright (c) 2022-2023 (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 Jan 03 14:35:42 CET 2022