"With" close
Hello !
I was surprised to discover that the "with" close is not a transparent
close !
I thought it only was a pre-compiler close but it doesn't seems to be !
I had a code like that :
// StuffForm1 is a normal window
// StuffForm2 is a MDI child window
// The code is in a procedure of the MDI parent window
// MyStuffForm2Property : TStuff read FMyStuffForm2Property write
SetMyStuffForm2Property ;
with StuffForm1 do
begin
(...)
TStuffForm2.Create(Self) ;
TStuffForm2(MDIChildren[MDIChildCount-1]).MyStuffForm2Property :=
MyStuffForm1Property ;
end ;
It didn't run !
When the program called the SetMyStuffForm2Property procedure, the MDI
Child was not assigned. With the de{*word*81} I saw its value at nil.
After a few try, I rewrite the code like that :
(...)
TStuffForm2.Create(Self) ;
TStuffForm2(MDIChildren[MDIChildCount-1]).MyStuffForm2Property :=
StuffForm1.MyStuffForm1Property ;
It runs !!
Any suggestions ?
Fran?ois Delaby.