title: Hexadecimal to Decimal Pascal Error Illegal Expression using Dev-Pascal
body: <p>I am creating a program that converts hexadecimal number to decimal number. Here is the code : </p>
  
  <pre><code>program hexadesimal;
  uses crt;
  var
  d, j, l, pow, y:integer;
  x:longint;
  h:string;
  label z;
  begin
  z:
  readln(h);
  d:=0;
  l:=length(h);
  for j:=1 to length(h) do
  begin
  if (h[j] = 'A') then h[j] = '10';
  if (h[j] = 'B') then h[j] = '11';
  if (h[j] = 'C') then h[j] = '12';
  if (h[j] = 'D') then h[j] = '13';
  if (h[j] = 'E') then h[j] = '14';
  if (h[j] = 'F') then h[j] = '15';
  l:=l - 1;
  pow := power(16, l);
  val(h[j], x, y);
  d := d + (x * pow);
  end;
  writeln(d);
  readln;
  end.
  </code></pre>
  
  <p>However, when I compiled, an error appeared illegal expression and it points at these lines : </p>
  
  <pre><code>if (h[j] = 'A') then h[j] = '10';
  if (h[j] = 'B') then h[j] = '11';
  if (h[j] = 'C') then h[j] = '12';
  if (h[j] = 'D') then h[j] = '13';
  if (h[j] = 'E') then h[j] = '14';
  if (h[j] = 'F') then h[j] = '15';
  </code></pre>
  
  <p>What should I do ?</p>