summaryrefslogtreecommitdiff
path: root/macros/GeneralFunctions
diff options
context:
space:
mode:
authorClément DAVID2017-11-24 09:24:25 +0100
committerClément DAVID2017-11-24 09:24:56 +0100
commit595d1bae76a45ebb7f2bb0b4f805c972377c7e1d (patch)
tree428c3622a9626cdca36460b2d7467ddb38c2b9c6 /macros/GeneralFunctions
parent8ed76898e795b952f509eccc425356a266f22843 (diff)
downloadscilab2c-595d1bae76a45ebb7f2bb0b4f805c972377c7e1d.tar.gz
scilab2c-595d1bae76a45ebb7f2bb0b4f805c972377c7e1d.tar.bz2
scilab2c-595d1bae76a45ebb7f2bb0b4f805c972377c7e1d.zip
fix some tests
Diffstat (limited to 'macros/GeneralFunctions')
-rw-r--r--macros/GeneralFunctions/filenamefprintf.sci15
1 files changed, 12 insertions, 3 deletions
diff --git a/macros/GeneralFunctions/filenamefprintf.sci b/macros/GeneralFunctions/filenamefprintf.sci
index f25e603e..de546feb 100644
--- a/macros/GeneralFunctions/filenamefprintf.sci
+++ b/macros/GeneralFunctions/filenamefprintf.sci
@@ -31,7 +31,15 @@ SCI2CNInArgCheck(argn(2),4,4);
// [FidReportFile, mess] = mopen(deblank(filename),'at+');
- [FidReportFile, mess] = mopen(filename,'a+');
+ if type(filename) == 1 then // double
+ FidReportFile = filename;
+ mess = "invalid filename";
+ elseif type(filename) == 10 then // string
+ [FidReportFile, mess] = mopen(filename,'a+');
+ else
+ FidReportFile = -1;
+ mess = "invalid filename type";
+ end
if (FidReportFile == -1) then
error(9999, mess);
end
@@ -43,6 +51,7 @@ SCI2CNInArgCheck(argn(2),4,4);
if ennewline=='y' then
mfprintf(FidReportFile,'\n');
end
- mclose(FidReportFile);
-
+ if type(filename) == 10 then
+ mclose(FidReportFile);
+ end
endfunction