I am trying to declare a constant array for validating type properties held by input object. but i am doing something incorrect, please have a look at below code:
// Record to hold Name-Value pair for checking entities
TValues = record
Name : WideString;
Value : Variant;
end;
const
coarrType1Properties : array[0..5] of TValues =
(
(Name : 'HARDWARE'; Value : TRUE),
(Name : 'SOFTWARE'; Value : TRUE),
(Name : 'TAG'; Value : TRUE),
(Name : 'AUTHORIZED'; Value : TRUE),
(Name : 'ID'; Value : 700),
(Name : 'CODE'; Value : 0)
);
but I am getting delphi compile time error for type value i.e. This type cannot be initialized. How to prevent this error? Or can we have alternate solution etc. Please assist...