string(1) to char?

Wed, 29 Nov 1995 15:08:37 -0500


can one convert a string of length one into a char?

ie the below wont work:

program t(input,output);
var
  ch:char;
   s:string(10);
begin
   s:='teststring';
   writeln(substr(s,2,1));
   ch:=substr(s,2,1);
   writeln(ord(ch));
end.

so, if one needs to get the ascii value of a particular
value in a string, does one have to fall back to 
the std pascal of using packed array of char?

  thomas

-- 
Thomas Dunbar    540 231-3938 (fax 3714)   http://gserver.grads.vt.edu/


Thomas Dunbar (tdunbar@gserver.grads.vt.edu)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es