// =============================================================================
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2015 - Scilab Enterprises - John GLIKSBERG
// Copyright (C) ????-2008 - INRIA
// Copyright (C) ????-2008 - ENPC
//
// =============================================================================
// <-- CLI SHELL MODE -->
function [rep]=Fprintf(varargin)
- fd = mopen(TMPDIR+"/fprintf.rep","w");
- varargin(0)=fd;
- mfprintf(varargin(:));
- mclose(fd);
- fd = mopen(TMPDIR+"/fprintf.rep","r");
- str = mgetstr(100,fd);
- mclose(fd);
- rep = str;
+ fd = mopen(TMPDIR+"/fprintf.rep","w");
+ varargin(0)=fd;
+ mfprintf(varargin(:));
+ mclose(fd);
+ fd = mopen(TMPDIR+"/fprintf.rep","r");
+ str = mgetl(fd);
+ mclose(fd);
+ rep = str;
endfunction
function [y]=bugnum(str1,str2,str3)
- [lhs,rhs] = argn(0);
- if rhs==3 then
- y = (str1<>str2) & (str1<>str3);
- else
- y = str1<>str2;
- end
+ [lhs,rhs] = argn(0);
+ if rhs==3 then
+ y = or(str1<>str2) & or(str1<>str3);
+ else
+ y = or(str1<>str2);
+ end
endfunction
// test format "%f"
// =============================================================================
if bugnum(Fprintf("%#.3X",12),"0X00C" ) then bugmes();quit;end
//----------test format %o
//if bugnum(Fprintf('%015o',-12),'000037777777764' ) then bugmes();quit;end
+//----------test column vector input
+if bugnum(Fprintf("%s\n", ["a";"b"]), ["a";"b"]) then bugmes();quit;end