diff options
author | pmarecha | 2008-06-05 08:49:05 +0000 |
---|---|---|
committer | pmarecha | 2008-06-05 08:49:05 +0000 |
commit | 42659d6cdbe63972aea27baf0289db8fcc1310fa (patch) | |
tree | 05cc1eb42b985cf657be112ae5a2e842a13c2126 /src/Scilab2C/SCI2CGeneral/PrintStepInfo.sci | |
parent | c4ca26eb9d2bbe224e41fc40658279cb865c48fc (diff) | |
download | scilab2c-42659d6cdbe63972aea27baf0289db8fcc1310fa.tar.gz scilab2c-42659d6cdbe63972aea27baf0289db8fcc1310fa.tar.bz2 scilab2c-42659d6cdbe63972aea27baf0289db8fcc1310fa.zip |
SVN is not FTP !
Diffstat (limited to 'src/Scilab2C/SCI2CGeneral/PrintStepInfo.sci')
-rw-r--r-- | src/Scilab2C/SCI2CGeneral/PrintStepInfo.sci | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/Scilab2C/SCI2CGeneral/PrintStepInfo.sci b/src/Scilab2C/SCI2CGeneral/PrintStepInfo.sci new file mode 100644 index 00000000..66d0653e --- /dev/null +++ b/src/Scilab2C/SCI2CGeneral/PrintStepInfo.sci @@ -0,0 +1,58 @@ +function PrintStepInfo(inputstring,filename,outputtype);
+// function PrintStepInfo(inputstring,filename,outputtype);
+// -----------------------------------------------------------------
+// Prints a string by using a predefined format into a file or on
+// the stdout.
+//
+// Input data:
+// filename: optional parameter, that specifies the output file.
+// If filename is '' or it is not provided to the function,
+// the string will be printed on the stdout.
+// outputtype: 'file' -> prints only on file.
+// 'stdout' -> prints only on the stdout.
+// 'both' -> prints on both file and stdoud.
+// Default is 'stdout'.
+// Output data:
+//
+// Status:
+// 02-Jan-2006 -- Nutricato Raffaele: Author.
+// 02-Jan-2006 -- Nutricato Raffaele: TEST OK.
+// -----------------------------------------------------------------
+
+if argn(2) < 3
+ bothout = 'n';
+ if argn(2) < 2
+ filename = '';
+ else
+ SCI2Cerror('Incorrect number of input arguments.');
+ end
+end
+if (length(filename) == 0)
+ outputtype = 'stdout'; // Prints only on the stdout.
+end
+
+Nstars = length(inputstring);
+starstring = [];
+for counterstars = 1:Nstars
+ starstring = starstring+'*';
+end
+blankstring = [' '];
+
+if ((outputtype=='both') | (outputtype=='stdout'))
+ // disp(' ')
+ // disp(' ')
+ disp(blankstring+' '+starstring);
+ disp(blankstring+'==> '+inputstring);
+ disp(blankstring+' '+starstring);
+ // disp(' ')
+end
+
+if ((outputtype=='both') | (outputtype=='file'))
+ filenamefprintf(filename,'y',' ');
+ filenamefprintf(filename,'y',' ');
+ filenamefprintf(filename,'y',blankstring+' '+starstring);
+ filenamefprintf(filename,'y',blankstring+'==> '+inputstring);
+ filenamefprintf(filename,'y',blankstring+' '+starstring);
+ filenamefprintf(filename,'y',' ');
+end
+endfunction
|