How do I define a range of floats?
I want to define a percentage type.
TPrecent = 0 .. 100;
works fine, but I can only assign integers to it an开发者_如何学编程 dwoudl also like to assign floats.
How can I do that?
Ranges can only be integer ordinal types. You will need to use a float variable and validate the value yourself.
TPercent is an integer sub-range. You cannot create a sub-range that is a floating point underlying type.
精彩评论