Page 2 of 2

Re: ButtonBar in resource ?

PostPosted: Tue Mar 24, 2015 4:22 am
by James Bott
Rao,

The point is we can not define a buttonbar of a dialog within the same function (or method) that defines the dialog itself, whether from resource or source. The buttonbar has to be defined in the INIT clause of the ACTIVATE DIALOG command.


Yes, I understand that was your point.

My point was to show that you do not need to pass lots of variables to a function if you use an object. My point was separate from yours, and I apologize if you thought I was being critical of your solution. I was just showing a way that Tim's variable passing problem could be solved with the use of an object.

Tim said:
Each variable would have to be passed to the button bar control when it's a separate function, and that can be a lot of variables.

This can be solved this way:

ACTIVATE DIALOG oDlg ON INIT myFunction( oCustomer )

James

Re: ButtonBar in resource ?

PostPosted: Thu Mar 26, 2015 4:13 pm
by TimStone
James,

I should have said "objects". In an Edit dialog there may be multiple data objects involved, and other variables may be in play ( arrays, etc ). They may also be changing status during the use of the edit control. Yes, they can be passed, but it has the potential for being more complex. When everything is in the one method, it's just easier.

Tim

Re: ButtonBar in resource ?

PostPosted: Thu Mar 26, 2015 5:33 pm
by James Bott
Ok, you could create an object just to contain everything you want to pass.

Re: ButtonBar in resource ?

PostPosted: Tue Apr 07, 2015 6:14 pm
by nageswaragunupudi
Mr Tim

Please see
viewtopic.php?f=3&t=30518

If you are reorganizing your code into two methods of a class, please wait. You may save lot of time with this new development.