Alan wrote:
> Joe wrote:
>
>> Can some one tell me How to compare 2 strings
>>
>> var
>> s1, s2: string
>>
>> s1:= 'John';
>> s2:= 'john';
>>
>> How could I compare the 2 strings to get a match
>
> if s1 = s2 then
> writeln('strings match');
>
> Of course, in your example the test would fail because the case
> doesn't match.
You also need to correct the code. Add a ';' after string in the
var section. Add a definition for string ahead in the type
section:
TYPE
string = array[1..4] of char;
unless you are using some sort of non-standard Pascal with a
predefined string type.
--
Merry Christmas, Happy Hanukah, Happy New Year
Joyeux Noel, Bonne Annee.
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
--
Posted via a free Usenet account from http://www.teranews.com


|