Home How to exclude the first element of an enumerated Type used as an array index in delphi?
Reply: 0

How to exclude the first element of an enumerated Type used as an array index in delphi?

user650
1#
user650 Published in May 24, 2018, 3:59 pm

I want to exclude the first value of this enumerated type

type
  TEnum = (val0, val1, val2, val3, val4);

in order to make this array

TBValues: array [low(TEnum)..High(TEnum)] of boolean;

contains only the last n-1 values (in this case n=5).

I tried this:

TBValues: array [low(TEnum)+1..High(TEnum)] of boolean; 

but I guess arithmetic operations are not allowed in this case because I'm getting this compiler error

E2010 Incompatible types: 'Int64' and 'TEnum'

How to do this?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.40293 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO