Only when {$LONGSTRINGS OFF}. Error: Data types which require initialization/finalization cannot be used in variant records.
In my example, string is not defined within variant part of the record. Do I still need {$LONGSTRINGS OFF}?
What I need in the end is an expression parser and evaluator.
https://wiki.freepascal.org/How_To_Use_TFPExpressionParserI found this page now, and there are similar approach to my idea (If I had read this in the past, I don't have to think over now).
type
TResultType = (rtBoolean, rtInteger, rtFloat, tDateTime, rtString);
TFPExpressionResult = record
ResString : String;
Case ResultType : TResultType of
rtBoolean : (ResBoolean : Boolean);
rtInteger : (ResInteger : Int64);
rtFloat : (ResFloat : TExprFloat);
rtDateTime : (ResDateTime : TDatetime);
rtString : ();
end;
I need one more type --- set or array. And there could be variables, whose values should be given from outside.