Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.0 - Français

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

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

Aide Scilab >> Fonctions avancées > funcprot

funcprot

switch scilab functions protection mode

Calling Sequence

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

Arguments

prot

integer with possible values 0, 1, 2

previousprot

integer with possible values 0, 1, 2 returns previous value

Description

Scilab functions are variable, funcprot allows the user to specify what scilab do when such variables are redefined.

  • If prot == 0 nothing special is done.

  • If prot == 1 scilab issues a warning message when a function is redefined (default mode).

  • If prot == 2 scilab issues an error when a function is redefined.

Examples

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)

History

VersionDescription
5.4.0 Previous value is returned as output argument when setting a new value.
Report an issue
<< fun2string Fonctions avancées head_comments >>

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 Oct 01 17:37:27 CEST 2012