Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

read and write procedure with enumerated type

neonkasneonkas Posts: 2Member
hi at all !

Excuse me for my scholastic english.
I'm testing the free pascal compiler of Lazarus 0.9.3

My pascal program

type
verb=(find,talk,learn,eat);
var
v:verb;
begin
readln(v);
write(v);
readln;
end.

I tested this program: it's wrong for TP7 and good for Lazarus.
My turbo pascal guide says I cannot read and write an enumerated type.
So my question is: is it a difference or a Lazarus/free pascal error?


other program

type
subra=1..10;
var
i:subra;
begin
i:=succ(10);
write(i);
readln;
end.

the same: it's wrong for tp7 and good for Lazarus even if it shows the message 'warning range check error while evaluating constants'.

My question is: Lazarus executes this program, is it a compiler problem?


Thanks in advance for your answers



Comments

Sign In or Register to comment.