HI ALL, i am still new to pascal and i cannot figure out how to execute the following bit of code properly. i know that the answer is staring me straight in the face but i just cant see it. i can get it to execute but it doesnt work properly. also would there be an easier way of coding it? please help as i have bee on this for hours.
write('NOW ENTER TAXCODE > ');
readln(TaxCode);
if (TaxCode[1]<'0')or(TaxCode[1]>'9')and
(TaxCode[2]<'0')or(TaxCode[2]>'9')and
(TaxCode[3]<'0')or(TaxCode[3]>'9')and
(TaxCode[4]<>'h')or(TaxCode[4]<>'l')
or(TaxCode[4]<>'H')or(TaxCode[4]<>'L')then;
begin
repeat
writeln('INVALID TAXCODE!! PLEASE DO IT AGAIN.> ');
readln(TaxCode);
until(TaxCode[1]>='0')and(TaxCode[1]<='9')
and(TaxCode[2]>='0')and(TaxCode[2]<='9')
and(TaxCode[3]>='0')and(TaxCode[3]<='9')
and(TaxCode[4]='l')or(TaxCode[4]='L')or(TaxCode[4]='h')or(TaxCode[4]='H');
end;
write('NOW ENTER TAXCODE > ');
readln(TaxCode);
if (TaxCode[1]<'0')or(TaxCode[1]>'9')and
(TaxCode[2]<'0')or(TaxCode[2]>'9')and
(TaxCode[3]<'0')or(TaxCode[3]>'9')and
(TaxCode[4]<>'h')or(TaxCode[4]<>'l')
or(TaxCode[4]<>'H')or(TaxCode[4]<>'L')then;
begin
repeat
writeln('INVALID TAXCODE!! PLEASE DO IT AGAIN.> ');
readln(TaxCode);
until(TaxCode[1]>='0')and(TaxCode[1]<='9')
and(TaxCode[2]>='0')and(TaxCode[2]<='9')
and(TaxCode[3]>='0')and(TaxCode[3]<='9')
and(TaxCode[4]='l')or(TaxCode[4]='L')or(TaxCode[4]='h')or(TaxCode[4]='H');
end;