type {$HINTS OFF} TMyClass = class private FBoo: boolean; public end; {$HINTS ON}
... var Form1: TForm1;
implementation
{$R *.dfm} // // NOTE: before and after procedure/function! NOT on "block of code" into procedure/function!!! // // ---> Hints it's NOT an "error"!!! it just ask you to review your code to do better!!! // { ...$WARNINGS OFF } // to avoid show "WARNINGS"
{$HINTS OFF } // to avoid show "HINTS" procedure TForm1.Button1Click(Sender: TObject); var MyVarEmptyAndDontUsed: boolean; begin
end; {$HINTS ON } { ...$WARNINGS ON }
procedure TForm1.FormCreate(Sender: TObject); var MyNewVarDontUsed: boolean; begin Caption := Self.Name; end;
end.
---------- the good sense said: --- if not necessary, then why have it?
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
any way, a "Field"/var with "unknow value / without value" is always dangerous in critical/specific situations!
that way, it's good dont have it defined or use any other way to define it or not! == if "X-situation" then "define A", else, "define B"
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
TRec = record ... fields regular case FieldXX : TMyEnums of meOne: ( fieldA:double ); // "field : type managed" see help to "records" meTwo : ( fieldB: double); end;
Note: the "variant-parts" can use distinct type, but you need know like use it on client-code --------- case FieldXX : TMyEnums of meOne: ( fieldA:double ); // "field : type managed" see help to "records" meTwo : ( fieldB: integer ); // OK = double and integer can works in general! ---------
FieldA and FieldB using same address on memory to assign its value, then, in fact, you'll have just "ONE" field.
ex. var MyRec : TRec; begin MyRec.FieldXX := meOne; MyRec.FieldA := 10.0; // MyRec.FieldXX := meTwo; MyRec.FieldB := 14.00;
MyRec.FieldA value = MyRec.FieldB value because, in fact, it's the same memory position to store the values (10.0 and 14.00), and the end, just "14.0" value will stay stored!
MyRec.FieldA = 14.0 / MyRec.FieldB = 14.00
"1" memory, to 2 possibilities on the context of programmer, just!
no hints :)
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3