diff options
author | simon | 2009-08-06 14:00:00 +0000 |
---|---|---|
committer | simon | 2009-08-06 14:00:00 +0000 |
commit | c76ca1b96e718c7ebfa986be8bf67663a2c468ae (patch) | |
tree | 7ffe277a1d9b856aeb127b486bdeb7c412968184 /macros | |
parent | 2cb32557766c38f6776c25f701c0935f76cf3c6d (diff) | |
download | scilab2c-c76ca1b96e718c7ebfa986be8bf67663a2c468ae.tar.gz scilab2c-c76ca1b96e718c7ebfa986be8bf67663a2c468ae.tar.bz2 scilab2c-c76ca1b96e718c7ebfa986be8bf67663a2c468ae.zip |
added FA_SZ_FROM_VAL to handle functions who determine the size of the ouput with the input arguments
updated INIT_FillSCI2LibCDirs
Diffstat (limited to 'macros')
-rw-r--r-- | macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci | 26 | ||||
-rw-r--r-- | macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci | 6 |
2 files changed, 29 insertions, 3 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci new file mode 100644 index 00000000..e9d88650 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci @@ -0,0 +1,26 @@ +function opout = FA_SZ_FROM_VAL(in1) +// function opout = FA_SZ_FROM_VAL(in1)
+// ----------------------------------------------------------------- +// Return a size according to the floored value of the first argument
+//
+// Input data:
+// in1: string specifying a number .
//
+//
+// Output data:
+// opout: string containing the computed result.
+//
+// ----------------------------------------------------------------- + +SCI2CNInArgCheck(argn(2),1,1);
+ +in1num = eval(in1) ; + +if ( in1num < 0 ) + opout= '0' ; +else + opout = string ( floor (abs(in1num))) ; +end + + + +endfunction diff --git a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci index 2de3fadb..0aac9f18 100644 --- a/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci +++ b/macros/ToolInitialization/INIT_FillSCI2LibCDirs.sci @@ -493,8 +493,8 @@ PrintStringInfo('NOUT= 1',ClassFileName,'file','y'); //Was FA_TP_USER //Cause some trouble if user specify some precision and if input(and also output) is complex. PrintStringInfo('OUT(1).TP= IN(1).TP',ClassFileName,'file','y'); -PrintStringInfo('OUT(1).SZ(1)= IN(1).VAL',ClassFileName,'file','y'); -PrintStringInfo('OUT(1).SZ(2)= IN(2).VAL',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(1)= FA_SZ_FROM_VAL(IN(1).VAL)',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= FA_SZ_FROM_VAL(IN(2).VAL)',ClassFileName,'file','y'); // --- Function List Class. --- ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); @@ -2057,7 +2057,7 @@ PrintStringInfo('NIN= 3',ClassFileName,'file','y'); PrintStringInfo('NOUT= 1 ',ClassFileName,'file','y'); PrintStringInfo('OUT(1).TP= FA_TP_USER',ClassFileName,'file','y'); PrintStringInfo('OUT(1).SZ(1)= ''1''',ClassFileName,'file','y'); -PrintStringInfo('OUT(1).SZ(2)= FA_SZ_RTMAX(IN(1).VAL)',ClassFileName,'file','y'); +PrintStringInfo('OUT(1).SZ(2)= FA_SZ_RTMAX(FA_SZ_FROM_VAL(IN(1).VAL))',ClassFileName,'file','y'); // --- Function List Class. --- ClassFileName = fullfile(SCI2CLibCFLClsDir,ClassName+ExtensionCFuncListCls); |