Paul Newton wrote: > Hi > > Is it ever possible to prove, scientifically or mathematically, that two > functions are exactly equivalent ? > You'd have to formally specify both functions, then prove the functions comply with the specification and finally prove both specifications are equivalent. It can be done, just don't ask me how, univ. days are long forgotten and it was a boring subject.
> For example, these two functions: > > Function StripCharsNew(tcInvalidValue, tcValidCharSet) > Local lcValidValue, lnCharNo > lcValidValue = tcInvalidValue > For lnCharNo = 1 to Len(tcInvalidValue) > If At(Substr(tcInvalidValue, lnCharNo, 1), tcValidCharSet) = 0 > lcValidValue = ChrTran(lcValidValue,Substr(tcInvalidValue, > lnCharNo, 1),tcReplaceChar) > EndIf > Next > Return lcValidValue > EndFunc > > Function StripCharsOld(tcInvalidValue, tcValidCharSet) > Local lcValidValue, lnCharNo > lcValidValue = "" > For lnCharNo = 1 to Len(tcInvalidValue) > If At(Substr(tcInvalidValue, lnCharNo, 1), tcValidCharSet) > 0 > lcValidValue = lcValidValue + Substr(tcInvalidValue, lnCharNo, > 1) > EndIf > Next > Return lcValidValue > EndFunc > > Thanks > _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

