import source from 1.3.40
[external/swig.git] / Examples / octave / enum / runme.m
1 # file: runme.m
2
3 example
4
5 # ----- Object creation -----
6
7 # Print out the value of some enums
8 printf("*** color ***\n");
9 printf("    RED    = %i\n", example.RED);
10 printf("    BLUE   = %i\n", example.BLUE);
11 printf("    GREEN  = %i\n", example.GREEN);
12
13 printf("\n*** Foo::speed ***\n");
14 printf("    Foo_IMPULSE   = %i\n", example.Foo_IMPULSE);
15 printf("    Foo_WARP      = %i\n", example.Foo_WARP);
16 printf("    Foo_LUDICROUS = %i\n", example.Foo_LUDICROUS);
17
18 printf("\nTesting use of enums with functions\n");
19
20 example.enum_test(example.RED, example.Foo_IMPULSE);
21 example.enum_test(example.BLUE,  example.Foo_WARP);
22 example.enum_test(example.GREEN, example.Foo_LUDICROUS);
23 example.enum_test(1234,5678)
24
25 printf("\nTesting use of enum with class method\n");
26 f = example.Foo();
27
28 f.enum_test(example.Foo_IMPULSE);
29 f.enum_test(example.Foo_WARP);
30 f.enum_test(example.Foo_LUDICROUS);
31
32