add more help pages related to CAPI - check parameters - optional parameters
[scilab.git] / scilab / modules / core / examples / capi / check_properties / check_properties.sce
1 // checks arguments compatibility 
2
3 check_properties_1([1;2;3;4],[3,4,5,6],[6;7;8;9],90,rand(5,5))
4
5 // first argument can have different types 
6
7 chprop2([1,2,2]);
8 chprop2('foo');
9
10 // overload case 
11
12 deff('[]=%sp_chprop2(sp)','disp(''sparse overloaded'')');
13 chprop2(sparse([1,2,3]));
14
15 // tests which give an error message with check_properties_1
16
17 try
18   check_properties_1([1;2;3;4]',[3,4,5,6],[6;7;8;9],90,rand(5,5))
19 catch
20   disp(lasterror());
21 end
22
23 try
24   check_properties_1([1;2;3;4],[3,4,5,6]',[6;7;8;9],90,rand(5,5))
25 catch
26   disp(lasterror());
27 end
28
29 try
30   check_properties_1([1;2;3;4],[3,4,5,6],[6;7;8;9]',90,rand(5,5))
31 catch
32   disp(lasterror());
33 end
34
35 try
36   check_properties_1([1;2;3;4],[3,4,5,6],[6;7;8;9],[],rand(5,5))
37 catch
38   disp(lasterror());
39 end
40
41 try
42   check_properties_1([1;2;3;4],[3,4,5,6],[6;7;8;9],90,rand(4,4))
43 catch
44   disp(lasterror());
45 end