Vlastimil Burián
Vlastimil Burián

Reputation: 3476

How to get highest/lowest ordinal value of user defined subrange type in Free Pascal

How to get highest/lowest ordinal value of user defined subrange type in Free Pascal?

Let's say we have this defined:

type
  LowChars = 'a'..'z';

And I need to get the highest/lowest value of the type.

Low(Ord(LowChars)) gives me the the lowest value of Char type, which is not what I want.

Thank you.

Upvotes: 0

Views: 101

Answers (1)

Vlastimil Burián
Vlastimil Burián

Reputation: 3476

OK, mystery solved Ord(Low(LowChars)) works.

Upvotes: 1

Related Questions