Would you like to declare a variable with a default value in Procedures?
procedure TfrmManutencao01.FormShow(Sender: TObject);
var
lPriAber : Boolean = True;
begin
.
.
.
end;
I know that as above Delphi does not accept.
Would you like to declare a variable with a default value in Procedures?
procedure TfrmManutencao01.FormShow(Sender: TObject);
var
lPriAber : Boolean = True;
begin
.
.
.
end;
I know that as above Delphi does not accept.
Responding directly to the question: No, Cannot initialize local variables
.
What you can do is declare the variable before the section implementation
var
FormX : TFormX;
lPriAber : Boolean = True;
This way you can use it in the procedure.
If by chance you do not change its value, you can locally declare it as constant.
procedure TfrmManutencao01.FormShow(Sender: TObject);
const
lPriAber : Boolean = True;
begin
..
end;
I still can not figure out the need.