Home > Back-end >  How Delphi const a TDictionary static variables?
How Delphi const a TDictionary static variables?

Time:09-19

Const
{$J +}
The FDic: TDictionary=nil;
{$J -}

Always an error:
[dcc32 Error] UploadInterface. Pas (29) : E2086 Type 'TDictionary 'is not yet completely defined

The great god, please give directions!!!!!!

CodePudding user response:

Should be the problem of TCookie definition,

CodePudding user response:

,,,
Why object, defined as a Const, you want to create well, defined as a Const, you how to create syntax can pass,

CodePudding user response:

Const is at compile time allocated memory directly, specify the value, cannot be changed during the operation of
You use object, compile time, can't determine to create, Delphi is need artificial creation, unlike c + + objects of that type of stack model, have a default constructor, the statement is to create,

CodePudding user response:

Delphi support writable constants, {$J +} is the compilation of switch function, so that there is no problem with,
But his definition of TCookie may have a problem, can be a generic class, if:
The FDic: TDictionary=nil;
Or
The FDic: TDictionary=nil;
There is no such problem,

CodePudding user response:

Const based entities, you establish the correct?
  • Related