I had a strange thing about renaming the type of the TValue array, for example:
TValueArray1 := TArray <TValue>;
TValueArray2 := Array of TValue;
I want to say that they should not behave the same? I have a method that has a constant TValue open array as an argument, but when I replace it with any TValueArray, the compiler starts to expect ordinal values, why?
For example, it works correctly;
procedure TAgBuffer.Add ( const AData: Array of TValue );
TAgBuffer.Add ( [(TValue.From <TGUID> ( G1 )), TValue.From <TBytes> ( B1 ), I1, S1] );
But after replacing "Array of TValue" with any TValueArray, it produces the following compiler errors: -
[dcc32 Error] Unit1.pas(44): E2001 Ordinal type required
[dcc32 Error] Unit1.pas(44): E2010 Incompatible types: 'Integer' and 'TValue'
source
share