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
|