A long time ago I remember I could do this in Turbo Pascal 7.
Maybe I’m wrong and it’s something I need to clarify, but is it possible to declare an array of strings as a constant?
If not what’s the option/workaround.
What I have now is:
type
TStates = (sOne, sTwo, sThree);
var
TArrayOfString: array [sOne..sThree] of string =
('State one', 'State two', 'State three');
but would want to replace that var with a const.
Thanks
Edit 1: Added some more code to clarify my question.
Just replacing var with const is perfectly legal:
I am curious why your identifier name starts with a T though. Were you trying to define a type like this:
You cannot have a variable length array (AFAIK) as a const, nor can you have it of an undefined type.
This is with Delphi 2009. YMMV with FreePascal.