03-04-2020, 10:09 AM
Soron,
did you notice that TIWForm1 is defined in "type" section?
It is like
type
in=integer;
and what you do is
in:= 3;
We need a variable of the type to assign its value. Since all delphi components are dynamic variables we need to create them first. There are two ways described below. The first one is not safe as we use a global variable "f". So we create a temporary variable that works only within a "with" statement, described as the second example. It is a little tricky method. Since form.create returns a value, we can intercept the value using "with" the same way as we do it with record variables.
https://www.sql.ru/forum/561505/with-tform-create-do
did you notice that TIWForm1 is defined in "type" section?
It is like
type
in=integer;
and what you do is
in:= 3;
We need a variable of the type to assign its value. Since all delphi components are dynamic variables we need to create them first. There are two ways described below. The first one is not safe as we use a global variable "f". So we create a temporary variable that works only within a "with" statement, described as the second example. It is a little tricky method. Since form.create returns a value, we can intercept the value using "with" the same way as we do it with record variables.
https://www.sql.ru/forum/561505/with-tform-create-do

