>I am having a difference of opinion on where to display a messagebox from.
>1. Within the method that test different passed variables.
>or
>2. From the code calling the method by returning a T/F or returning the message to display and checking to see if empty(msg) to determine if displayed
>
>I choose #2 mainly because I read somewhere that meesages should not be displayed from a method and it clearer coding.
>
>Thanks for any opinions, Chuck
Actually, the mesasage box should be displayed by an object that has UI responsibilities such as a form. For example, if I have a form that displays data to the user and in thsat form I have a text box that obtains a certain value. In the Textbox.Valid I have code that instantiates a business object and then calls a method of that object to validate the value in the data, then the Business object's method would return a T/F as to whether the data is valid (it's job, determine the validity of the value), the textbox.Valid would detect the value of .F. as being an invlaid value (its job, react to the invalid value) and the textbox.Valid would, among other possible actions, call a method of the form to announce to the user that the value is not valid (the job of the form, talk to the user).