>>>I changed the top part (up to OK to close drawer) into a separate method. The question now is - can I re-use this piece somehow in two places?
>>>
>>>
>>>String currentOperator, currentSalespoint, closeOperator, closeSalespoint, cDetails;
>>> currentOperator = GetParameterValue(parameters, "tcOperator");
>>> currentSalespoint = GetParameterValue(parameters, "tcSalespoint");
>>> cDetails = GetParameterValue(parameters, "tcDetails");
>>> closeOperator = cDetails.ParseStringFromSqml("CLOSE_OP");
>>> if (String.IsNullOrWhiteSpace(closeOperator))
>>> closeOperator = currentOperator;
>>> closeSalespoint = cDetails.ParseStringFromSqml("CLOSE_SP");
>>> if (String.IsNullOrWhiteSpace(closeSalespoint))
>>> closeSalespoint = currentSalespoint;
>>> DateTime startTime, endTime;
>>> startTime = cDetails.ParseDateTimeFromSqml("START_TIME");
>>> endTime = cDetails.ParseDateTimeFromSqml("END_TIME");
>>>
>>>
>>>?
>>>
>>>I guess I can pass back all parameters by reference, but is it a good solution?
>>>
>>It isn't so difficult to see that that method needs as
>>In Parameters : parameters
>>Out Parameters: startTime, endTime
>>
>>
>>void TheMethod( type of parameters, out DateTime startTime, out DateTime endTime)
>>{
>> // the code
>>}
>>
>
>It actually also needed closeSalespoint and closeOperator. I sent both as out parameters but I was thinking I may create the above as a class instead with these properties. Do you think it will be a better solution or 4 out parameters is not bad?
Dunno - there are several ways
Viv's personal limit is about 5
Another option mentioned is to have the method return a Tuple - only inconvenience of a tuple is that the properties do not have meaningful names
Another option suggested is to create a class. I would opt for a private nested class in that case
Gregory