aboutsummaryrefslogtreecommitdiff
path: root/Examples/scilab/std_list/runme.sci
blob: e4c04b029f5aea45b1f90117a143d800ce69e724 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
lines(0);
ilib_verbose(0);
ierr = exec('loader.sce', 'errcatch');
if ierr <> 0 then
  disp(lasterror());
  exit(ierr);
end
example_Init();

// This example shows how to use C++ fonctions with STL lists arguments
// Here, STL lists are converted from/to Scilab matrices (SWIG_SCILAB_EXTRA_NATIVE_CONTAINERS is not defined)

// integer lists

disp("Example of passing matrices of int as list arguments of C++ functions.");
disp("get a list of int {1...4} from create_integer_list():");
is = create_integer_list(1, 4);
disp(is);
disp("get the sum of this list elements with sum_integer_list():")
sum = sum_integer_list(is);
disp(is);
is2 = create_integer_list(3, 6);
disp("concat this list with the list of int {3...6} with concat_integer_list():");
is3 = concat_integer_list(is, is2);
disp(is3);

// string lists

disp("Example of passing matrices of string as list arguments of C++ functions.");
disp("get a list of string {''aa'', ''bb'', ''cc'', ''dd''} with create_string_list():");
ss = create_string_list("aa bb cc dd");
disp(ss);
ss2 = create_string_list("cc dd ee ff");
disp("concat this list with the list of string {''cc'', ''dd'', ''ee'', ''ff''} with concat_string_list():");
ss3 = concat_string_list(ss, ss2);
disp(ss3);

exit