= GetCurrentandClose((parameters, "tcOperator", "CLOSE_OP", cCurrentOperator, cCloseOperator); = GetCurrentandClose((parameters, "tcSalespoint", "CLOSE_SP", cCurrentSalespoint, cCloseSalespoint); function GetCurrentandClose(parameters, in string cCurrentTag, in string cCloseTag, out string cCurrent, out string cClose) { cCurrent = GetParameterValue(parameters, cValueTag); cClose = cDetails.ParseStringFromSqml(cCloseTag); if (String.IsNullOrWhiteSpace(cClose)) cClose = cCurrent; };As you have good naming conventions in the part shown, you could use a Dictionay and string functions for all keys, names and so on, but that borders on being script/vfp like and not statically typed and all. Of course the same approach would work with massaging the property names for a class based solution. Signature is MUCH nicer if you are certain that this pattern is always well named, or if you encounter less well named instances, it is a good time for overloading and calling the base functionality.
>private void ParseDetails(String cDetails, String currentOperator, > String currentSalespoint, out String closeOperator, out String closeSalespoint, out DateTime startTime, out DateTime endTime) >{ > closeOperator = cDetails.ParseStringFromSqml("CLOSE_OP"); > if (String.IsNullOrWhiteSpace(closeOperator)) > closeOperator = currentOperator; > closeSalespoint = cDetails.ParseStringFromSqml("CLOSE_SP"); > if (String.IsNullOrWhiteSpace(closeSalespoint)) > closeSalespoint = currentSalespoint; > > startTime = cDetails.ParseDateTimeFromSqml("START_TIME"); > endTime = cDetails.ParseDateTimeFromSqml("END_TIME"); >} >