You are trying to initialize a variable as part of its declaration. The documentation states that the syntax must be:
var identifier: type = constantExpression;
where constantExpression is any constant expression representing a
value of type type.
The documentation for constant expressions says (emphasis mine):
A constant expression is an expression that the compiler can evaluate without executing the program in which it occurs. Constant expressions include numerals; character strings; true constants; values of enumerated types; the special constants True, False, and nil; and expressions built exclusively from these elements with operators, typecasts, and set constructors. Constant expressions cannot include variables, pointers, or function calls.
You are contravening the final sentence, specifically the part that I have highlighted.
It's quite possible that all you want to do is declare an array of strings. In which case you would simply write:
var
CloneTaskArray: array[0..19] of string;
If you need to initialize this array, do so in the initialization section of the unit that declares them:
initialization
CloneTaskArray[0] := 'boo';
CloneTaskArray[1] := 'yah';
....
I note that you are trying to initialize the elements of the array with other string variables. With a simpler example, I wonder if you are trying to do this:
var
s1, s2: string;
StringArray: array[0..1] of string;
....
StringArray[0] := s1;
StringArray[1] := s2;
and then I wonder if you are hoping that you can do this:
s1 := 'boo';
Assert(StringArray[0] = 'boo');
If that's what you are hoping for, you will be disappointed. The string data type in Delphi is quite complex, but fundamentally it behaves like a value type. If you are trying to do what I outline above you'll need to use references to string variables:
type
PString = ^string;
var
s1, s2: string;
StringArray: array[0..1] of PString;
....
StringArray[0] := @s1;
StringArray[1] := @s2;
and then you can indeed write:
s1 := 'boo';
Assert(StringArray[0]^ = 'boo');
CloneTaskArray : array[0..19] of String;LCloneTask1instead readCloneTaskArray[0]. Or, as David describes below, use pointers to those strings.CloneTaskArray : array[0..19] of String;