Hi

Hi,
I have a custom string type called TMyString. And i have an array of TMyString :
type 
TMyString = AnsiString;

const 
MyItem1 : TMyString = 'yyy';
MyItem2 : TMyString = 'xxx';
MyItem3 : TMyString = 'zzz';

MyArray:array[0..2]of TMyString = (//
MyItem1,
MyItem2,
MyItem3);

Every time ,i try to run my code ,i got :"E2026 Constant expression expected" error.
Items (MyItemX) need to be declared as constant , so when changing ,MyArray will get updated. 
Is there any way to make the code run without converting Items to quoted string in MyArray ?.

Comments

Post a Comment