%
% tagsOut=addchntag(tags, tag, chn, offset, len)
%
% version 0.1 (1999-12-01)

function tagOut=addchntag(tags, tag, chn, offset, len)
if (nargin~=5)
   error('tagsOut=addchntag(tags, tag, chn, offset, len)');
   return;
end

if (tags(1,1)==0)
   index=1;
else	
   index=size(tags,1)+1;
end	


tagOut=zeros(index,5);
if index~=1
   tagOut(1:index-1,:)=tags(1:index-1,:);
end

tagOut(index, 1)=3;
tagOut(index, 2)=chn;
tagOut(index, 3)=tag;
tagOut(index, 4)=offset;
tagOut(index, 5)=len;
