Scilab: constants example consistent with other languages
This commit is contained in:
parent
25cb1f2094
commit
06617dbd0b
2 changed files with 13 additions and 34 deletions
|
|
@ -1,7 +1,8 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
|
||||
/* A few preprocessor macros */
|
||||
/* Forces to wrap constants as Scilab variables (instead of functions) */
|
||||
%scilabconst(1);
|
||||
|
||||
#define ICONST 42
|
||||
#define FCONST 2.1828
|
||||
|
|
@ -24,17 +25,5 @@
|
|||
%constant int iconst = 37;
|
||||
%constant double fconst = 3.14;
|
||||
|
||||
/* Now constants are wrapped to Scilab variables */
|
||||
%scilabconst(1);
|
||||
|
||||
#define ICONST2 12
|
||||
#define FCONST2 4.60
|
||||
#define CCONST3 'a'
|
||||
#define CCONST4 '\n'
|
||||
#define SCONST3 "Hello World"
|
||||
#define SCONST4 "\"Hello World\""
|
||||
|
||||
%constant int iconst2 = 73;
|
||||
%constant double fconst2 = 6.28;
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue