function blkname = hdlblkmask_bitslice
% Mask dynamic dialog function for BitSlice block

% Copyright 2007-2011 The MathWorks, Inc.
%

% Cache handle to block
blk = gcbh;

% Get mode value
lindex = get_param(blk, 'lidx');
rindex = get_param(blk, 'ridx');
if((str2double(lindex) <0))
error('MSB position should not be negative')
end
if( (str2double(rindex)<0))
error('LSB position should not be negative')
end
if(str2double(lindex) < str2double(rindex))
error('MSB position should not be less than LSB position')
end

% define the name that will appear on the mask
isBlkInLibrary = strcmp(get_param(bdroot(blk),'BlockDiagramType'),'library');
if isBlkInLibrary
blkname = 'Slice';
else
blkname = ['Slice\n(', lindex, ' downto ', rindex, ')'];
end