开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜