1
function [x,y,typ]=WFILE_f(job,arg1,arg2)
8
[x,y,typ]=standard_inputs(o)
12
[x,y]=standard_origin(arg1)
15
graphics=arg1.graphics;exprs=graphics.exprs
22
[ok,in,fname1,frmt1,N,exprs]=getvalue(..
23
'Set WFILE block parameters',..
28
list('vec',1,'str',1,'str',1,'vec',1),exprs)
29
if ~ok then break,end //user cancel modification
33
fname1=stripblanks(fname1)
34
frmt1=stripblanks(frmt1)
36
if lunit>0&min(length(frmt),1)<>min(length(frmt1),1) then
37
mess=[mess;'You cannot swich from formatted to unformatted';
38
'or from unformatted to formatted when running';' ']
40
if lunit>0&fname1<>fname then
41
mess=[mess;'You cannot modify Output file name when running';' ']
45
mess=[mess;'Buffer size must be at least 2';' ']
49
mess=[mess;'Block must have at least one input';' ']
53
message(['Some specified values are inconsistent:';
58
ipar=[length(fname1);length(frmt1);0;N;str2code(fname1);str2code(frmt1)]
59
if prod(size(dstate))<>(nin+1)*N+2 then
60
dstate=[-1;lunit;zeros((nin+1)*N,1)]
63
model.dstate=dstate;model.ipar=ipar
64
model.dep_ut=[%t %f] //compatibility
66
x.graphics=graphics;x.model=model
81
model.dstate=[-1;lunit;zeros((nin+1)*N,1)]
82
model.ipar=[length(fname);length(frmt);0;N;str2code(fname);str2code(frmt)]
90
gr_i=['txt=[''write to'';''output file''];';
91
'xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')']
92
x=standard_define([3 2],model,exprs,gr_i)