summaryrefslogtreecommitdiff
path: root/macros/GeneralFunctions/filenamefprintf.sci
diff options
context:
space:
mode:
authorSunil Shetye2019-05-16 12:18:48 +0530
committerSunil Shetye2019-05-29 11:08:01 +0530
commit26b77d7593b5ee0792b6b556f5569ea4227c2b02 (patch)
tree8f92052234b01bf39b9c3a6e3cb12b3962d96b1b /macros/GeneralFunctions/filenamefprintf.sci
parent5a73e6bec4a12db7afae9de300e39256f754d8d3 (diff)
downloadscilab2c-26b77d7593b5ee0792b6b556f5569ea4227c2b02.tar.gz
scilab2c-26b77d7593b5ee0792b6b556f5569ea4227c2b02.tar.bz2
scilab2c-26b77d7593b5ee0792b6b556f5569ea4227c2b02.zip
convert to unix format
Diffstat (limited to 'macros/GeneralFunctions/filenamefprintf.sci')
-rw-r--r--macros/GeneralFunctions/filenamefprintf.sci114
1 files changed, 57 insertions, 57 deletions
diff --git a/macros/GeneralFunctions/filenamefprintf.sci b/macros/GeneralFunctions/filenamefprintf.sci
index de546feb..b9650eeb 100644
--- a/macros/GeneralFunctions/filenamefprintf.sci
+++ b/macros/GeneralFunctions/filenamefprintf.sci
@@ -1,57 +1,57 @@
-function filenamefprintf(filename,ennewline,str,formattedstring)
-// function filenamefprintf(filename,ennewline,str,formattedstring)
-// --------------------------------------------------------------------------------
-// Uses the printf to print the string specified by varargin. filenamefprintf
-// uses the filename instead of the fid parameter used by fprintf.
-// Everytime filenamefprintf is called it
-// opens the file, prints the string in it and then closes it.
-// Opening is performed in read/append mode (at+).
-//
-// Input data:
-// filename: string that specifies the name of the file.
-// varargin are the input arguments for the printf.
-// formattedstring: if 'n' (default) it means that str is considered as a simple string (mputstr).
-// if 'y' then str is considered formatted according to mfprint syntax
-//
-// Output data:
-// ---
-//
-// Status:
-// 31-Jan-2006 -- Nutricato Raffaele: Author.
-// 31-Jan-2006 -- Nutricato Raffaele: TEST OK.
-//
-// Copyright 2006 Raffaele Nutricato.
-// Contact: raffaele.nutricato@tiscali.it
-// -----------------------------------------------------------------
-
-// ------------------------------
-// --- Check input arguments. ---
-// ------------------------------
-SCI2CNInArgCheck(argn(2),4,4);
-
-
-// [FidReportFile, mess] = mopen(deblank(filename),'at+');
- 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
- if formattedstring == 'n'
- mputstr(str,FidReportFile);
- else
- mfprintf(FidReportFile, str);
- end
- if ennewline=='y' then
- mfprintf(FidReportFile,'\n');
- end
- if type(filename) == 10 then
- mclose(FidReportFile);
- end
-endfunction
+function filenamefprintf(filename,ennewline,str,formattedstring)
+// function filenamefprintf(filename,ennewline,str,formattedstring)
+// --------------------------------------------------------------------------------
+// Uses the printf to print the string specified by varargin. filenamefprintf
+// uses the filename instead of the fid parameter used by fprintf.
+// Everytime filenamefprintf is called it
+// opens the file, prints the string in it and then closes it.
+// Opening is performed in read/append mode (at+).
+//
+// Input data:
+// filename: string that specifies the name of the file.
+// varargin are the input arguments for the printf.
+// formattedstring: if 'n' (default) it means that str is considered as a simple string (mputstr).
+// if 'y' then str is considered formatted according to mfprint syntax
+//
+// Output data:
+// ---
+//
+// Status:
+// 31-Jan-2006 -- Nutricato Raffaele: Author.
+// 31-Jan-2006 -- Nutricato Raffaele: TEST OK.
+//
+// Copyright 2006 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+SCI2CNInArgCheck(argn(2),4,4);
+
+
+// [FidReportFile, mess] = mopen(deblank(filename),'at+');
+ 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
+ if formattedstring == 'n'
+ mputstr(str,FidReportFile);
+ else
+ mfprintf(FidReportFile, str);
+ end
+ if ennewline=='y' then
+ mfprintf(FidReportFile,'\n');
+ end
+ if type(filename) == 10 then
+ mclose(FidReportFile);
+ end
+endfunction