[fpc-pascal]a problem about pascal programing

Adam Naumowicz adamn at math.uwb.edu.pl
Sat Dec 15 16:19:38 CET 2001


On Sat, 15 Dec 2001, [big5] ¶¾¤åªN wrote:

> Hi,
> I am beginner of pascal programing. I have a question about that I can't use a numeral as am element of enumerated data type such as"type items=(1,2,3,4)". You may refer to the attached file to get more information abou my problem. I am looking forward the help from you.Thanks.
.....
> type  items=(1,2,3,4);

Only valid pascal identifiers can be used in enumerated type declaration.
FPC supports also C-style enums (assigned enumerated types, see FPC's
reference guide). But I suppose that in your case a subrange type like:

type items = 1..4;

can be used (altough I can't see no serious reason for so strict range
checking at all in the program you attached).

Regards,
Adam Naumowicz

--------------------------------------
WWW: http://math.uwb.edu.pl/~adamn/
--------------------------------------





More information about the fpc-pascal mailing list