2
You could declare a variable with a default value in Procedures?
procedure TfrmManutencao01.FormShow(Sender: TObject);
var
lPriAber : Boolean = True;
begin
.
.
.
end;
I know that as it is above Delphi does not accept.
2
You could declare a variable with a default value in Procedures?
procedure TfrmManutencao01.FormShow(Sender: TObject);
var
lPriAber : Boolean = True;
begin
.
.
.
end;
I know that as it is above Delphi does not accept.
5
Directly answering 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;
That way you can use it in the procedure.
If by chance it is not changing its value, one can locally declare it as constant.
procedure TfrmManutencao01.FormShow(Sender: TObject);
const
lPriAber : Boolean = True;
begin
..
end;
I still can’t understand the need.
It was just to clear a doubt... Thank you!
Browser other questions tagged delphi delphi-7 variable-declaration delphi-10
You are not signed in. Login or sign up in order to post.
And what the need to be in the body of the procedure?
– Junior Moreira
I just wanted to know why a friend asked me and I’m in a place without Delphi installed.
– Edu Mendonça