summaryrefslogtreecommitdiffstats
path: root/scilab/modules/parameters
diff options
context:
space:
mode:
authorYann Collette <yann.collette@scilab.org>2010-04-15 10:01:31 +0200
committerYann Collette <yann.collette@scilab.org>2010-04-15 10:01:31 +0200
commit5ed24f65118ace485d8e75827ffb8435b60a1106 (patch)
treebeed8425081f2a2939c76e997da2d2ce5b8e00a8 /scilab/modules/parameters
parenta071c0b6e980d720d5488562c137d711c0332fff (diff)
downloadscilab-5ed24f65118ace485d8e75827ffb8435b60a1106.zip
scilab-5ed24f65118ace485d8e75827ffb8435b60a1106.tar.gz
add the possibility to initialize a non empty parameter list
Diffstat (limited to 'scilab/modules/parameters')
-rw-r--r--scilab/modules/parameters/macros/init_param.sci22
1 files changed, 18 insertions, 4 deletions
diff --git a/scilab/modules/parameters/macros/init_param.sci b/scilab/modules/parameters/macros/init_param.sci
index c378b13..416e923 100644
--- a/scilab/modules/parameters/macros/init_param.sci
+++ b/scilab/modules/parameters/macros/init_param.sci
@@ -1,5 +1,5 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2008 - Yann COLLETTE <yann.collette@renault.com> 2// Copyright (C) DIGITEO 2008-2010 - Yann COLLETTE
3// 3//
4// This file must be used under the terms of the CeCILL. 4// This file must be used under the terms of the CeCILL.
5// This source file is licensed as described in the file COPYING, which 5// This source file is licensed as described in the file COPYING, which
@@ -7,7 +7,21 @@
7// are also available at 7// are also available at
8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 9
10function ga_list = init_param() 10function plist = init_param(varargin)
11ga_list = mlist(['plist'],[]); 11param_name = [];
12endfunction 12param_val = [];
13if (modulo(length(varargin),2)~=0) then
14 error(sprintf(gettext("%s: Wrong number of input argument(s): %s expected.\n"),"init_param",gettext("even number")));
15end
16for i=1:2:length(varargin)
17 if typeof(varargin(i))~='string' then
18 error(sprintf(gettext("%s: Wrong type for input argument #%d: %s expected.\n"),"init_param",i,gettext("string")));
19 end
20end
21
22plist = mlist(['plist'],[]);
13 23
24for i=1:2:length(varargin)
25 [plist, _err] = add_param(plist,varargin(i),varargin(i+1));
26end
27endfunction