function [stat,post] = blkgain(path,prop,bstr,bint,bflt,parent,name,catalog,ws,node)
%BLKGAIN Specifies a gain relationship between input and output.
%

% Initial coding by A S Bozin, 6-7-97
% Copyright 1997-2000 The MathWorks, Inc.
% $Revision: 1.6 $ $Date: 2000/06/14 16:09:20 $

   stat = 0;			   		   % Error flag
   nInputs = bint(5);
   nOutputs = bint(6);
   %
   % Build mux and demux if necessary
   %
   [post,rect] = blkio('port',nInputs,nOutputs,prop,path);
   %
   % Get the block gains
   %
   indInt = bint(15)+1;
   mode = bint(indInt);
   symInd = 0;
   str = cell(size(symInd));
   if (bitand(mode,16))
      indStr = bint(17)+1;
      ind = mfindstr(bstr,indStr,'|');
      symInd(1) = 1;
      str{1} = bstr(indStr:ind-1);
   end
   %
   % Get the block parameter variables
   %
   [symInd,str] = mgetscope(symInd,str,catalog,ws,node);
   if (symInd == 0)
      indFlt = bint(19);
      gRange = 1:nInputs;
      str{1} = mat2char(bflt(indFlt+gRange));
   end
   %
   % Gain block
   %
   bh = add_block('built-in/Gain',path,...
		  'ForegroundColor',prop.fgColor,...
		  'BackgroundColor',prop.bgColor,...
		  'Orientation',prop.orientation,...
		  'DropShadow',prop.border,...
		  'Position',rect,...
		  'Gain',str{1});
   %
   % Connect the current block with the mux and demux blocks (if any)
   %
   blkio('line',nInputs,nOutputs,post,parent,name);
   return					   % Last card of BLKGAIN
