Or somewhat more concise: method-id IsValidData returning myRet as condition-value. set myRet to Validator::IsPresent(txtCode) and Validator::IsDecimal(txtPrice) end method IsValidData. Whether this is better is a matter of opinion, of course; it's just a stylistic difference. Personally, since this method has no parameters and is a function of the state of the object, I'd make it a property: method-id get property IsValidData returning myRet as conditiion-value. set myRet to Validator::IsPresent(txtCode) and Validator::IsDecimal(txtPrice) end method. Or equivalently: property-id IsValidData condition-value. getter. set property-value to Validator::IsPresent(txtCode) and Validator::IsDecimal(txtPrice) end property IsValidData. Note all of this assumes Validator is non-null, etc.
↧