Range must be bounded by constant expressions

In reply to saroj kumar sahoo:

function void strobe(int r);
  bit [15:0] mask;
  mask = (15'b1 << 4*r) - 1;
  WDATA =  Data ^ (mask & 15'hXXXX);
  $display("WDATA = %0h",WDATA);
endfunction