File: funcprot.dia.ref

package info (click to toggle)
scilab 5.3.3-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 330,656 kB
file content (24 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) ????-2008 - INRIA
//
//  This file is distributed under the same license as the Scilab package.
// =============================================================================
// <-- ENGLISH IMPOSED -->
//funcprot
deff("foo()","a=1");
funcprot(0);
if funcprot() <> 0 then bugmes();quit;end
if execstr("deff(""foo()"",""a=1"");","errcatch") <> 0 then bugmes();quit;end
deff("foo()","a=2");
funcprot(1);
if funcprot() <> 1 then bugmes();quit;end
if execstr("deff(""foo()"",""a=3"");","errcatch") <> 0 then bugmes();quit;end
Warning : redefining function: foo                     . Use funcprot(0) to avoid this message

deff("foo()","a=4")
Warning : redefining function: foo                     . Use funcprot(0) to avoid this message

funcprot(2);
if funcprot() <> 2 then bugmes();quit;end
if execstr("deff(""foo()"",""a=5"");","errcatch") == 0 then bugmes();quit;end