Board index » delphi » Logical Operator Problem

Logical Operator Problem

Hi

I can't get the logical operator to work logically.
Can anyone help?

gotoxy(15,9);
write('Serviceman_Age      : ');
Readln (result[counter].Serviceman_Age);
if (serviceman_age >=16) and (serviceman_age <25) then
begin
    gotoxy(15,10);
    writeln('age group is Cat X');
end
    else
        begin
            gotoxy(15,10);
            writeln('age group is Cat Y');
        end;
gotoxy(15,12);
writeln('Enter IPPT Results');

If I use the statement in line 3,
any age that I enter will still be under cat X
but if i replace line 3 with readln(serviceman_age);
it works just fine.
So where did I go wrong?

Regards

Poh San
Email: ps7577...@pacific.net.sg

 

Re:Logical Operator Problem


I would like to see what is before... declarations..
Lim Poh San ha scritto nel messaggio <7c99id$pp...@newton.pacific.net.sg>...
Hi

I can't get the logical operator to work logically.
Can anyone help?

gotoxy(15,9);
write('Serviceman_Age      : ');
Readln (result[counter].Serviceman_Age);
if (serviceman_age >=16) and (serviceman_age <25) then
begin
    gotoxy(15,10);
    writeln('age group is Cat X');
end
    else
        begin
            gotoxy(15,10);
            writeln('age group is Cat Y');
        end;
gotoxy(15,12);
writeln('Enter IPPT Results');

If I use the statement in line 3,
any age that I enter will still be under cat X
but if i replace line 3 with readln(serviceman_age);
it works just fine.
So where did I go wrong?

Regards

Poh San
Email: ps7577...@pacific.net.sg

Other Threads