w***@remov.yahoo.com
2007-06-06 16:31:21 UTC
OK
After being shown the light on global variable being a bad thing. I'm
looking at how to pass information around.
Is it possible for a C++Builder Form to have a return value? And were in the
Unit ( Or how ) would the return be placed? But as I understand it, "return"
exits the function right then, so would any of the cleanup ( destructors ect
) occur?
A simple thought
struct Data
{
int a, b;
}
Data D1;
D1 = Form2->ShowModal();
And somewhere inside Form2--------------
Data D2;
D2.a = 1;
D2.b = 2;
return D2;
OR
Maybe the way to do it is pass Form2 the address of D1 ( &D1 ) and just let
the form manipulate the variable that way. But how ( or should ) I change
the header information
OK, Back to the C++ Builder Books, and see if I can figure it out.... Just
when I thought I had pointers figured out...LOL
Thanks in advance
Michael
After being shown the light on global variable being a bad thing. I'm
looking at how to pass information around.
Is it possible for a C++Builder Form to have a return value? And were in the
Unit ( Or how ) would the return be placed? But as I understand it, "return"
exits the function right then, so would any of the cleanup ( destructors ect
) occur?
A simple thought
struct Data
{
int a, b;
}
Data D1;
D1 = Form2->ShowModal();
And somewhere inside Form2--------------
Data D2;
D2.a = 1;
D2.b = 2;
return D2;
OR
Maybe the way to do it is pass Form2 the address of D1 ( &D1 ) and just let
the form manipulate the variable that way. But how ( or should ) I change
the header information
OK, Back to the C++ Builder Books, and see if I can figure it out.... Just
when I thought I had pointers figured out...LOL
Thanks in advance
Michael