1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function s2 = %c_i_r(i,j,s1,s2)
14
15    if type(i)==10 then  // sl('dt')
16        [lhs,rhs] = argn(0)
17        if rhs <> 3 then
18            msg = _("%s: Invalid index.\n")
19            error(msprintf(msg, "%c_i_r"))
20        end
21        if i<>"dt" then
22            error(msprintf(_("%s: Wrong type for input argument #%d.\n"),"%c_i_r",1));
23        end
24        s2 = s1;
25        kf = 4
26        if j <> "c" & j <> "d" then
27            msg = _("%s: Wrong value for input argument #%d: ''c'', ''d'' or a scalar expected.\n")
28            error(msprintf(msg, "%c_i_r", 2));
29        end
30        s2(kf) = j
31    end
32endfunction
33