Re: [fpc-pascal] Re: What is wrong with this enum and array related code

2010-09-12 Thread Honza
2010/9/12 Frank Church : > Does that mean that although an enum is an ordinal type, an integer cannot > be coerced into using it to index an array? IMO just cast it to the correct type (of the array index) giving the compiler a chance to accept it. -- bflm freepascal-bits.blogspot.com __

Re: [fpc-pascal] Re: What is wrong with this enum and array related code

2010-09-12 Thread Frank Church
On 12 September 2010 13:05, Vincent Snijders wrote: > 2010/9/12 Frank Church : > > I need to elaborate more on this code > > > > On this line > > > > d := stTypes[i - Ord(low(stType))]; > > > > since stTypes is an array, I expect stTypes[n], with n being 1 to 4, to > > retrieve an array value and

Re: [fpc-pascal] Re: What is wrong with this enum and array related code

2010-09-12 Thread Vincent Snijders
2010/9/12 Frank Church : > I need to elaborate more on this code > > On this line > > d := stTypes[i - Ord(low(stType))]; > > since stTypes is an array, I expect stTypes[n], with n being 1 to 4,  to > retrieve an array value and as 'i - Ord(low(stType)) evaluates to integer it > should compile but