
Untitled
By: a guest on
Apr 24th, 2012 | syntax:
None | size: 0.50 KB | hits: 18 | expires: Never
Return value of parameterized methods?
bool inputOk = ReadAndValidateInput(out customerName, out seatPrice);
private bool ReadAndValidateInput(out string name, out double price)
double discount = 0;
if(ReadAndValidateInput(customerName, seatPrice, out discount))
{
//do something with discount. You know that input was valid
}
else
{ // do not touch discount. User has not entered valid values
}
string name;
double price;
bool inputOk = ReadAndValidateInput(out customerName, out seatPrice);