× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Simon, et al

A very interesting discussion.


-----Message d'origine-----
De : rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] De la part de Simon Coulter

New procedure: validateName( validateThis : withThat )
This has the body of the code and performs the
validation giving a result that indicates whether validation
was successful (this could be simple TRUE/FALSE or a number
indicating the position of the first invalid character in
which case 0 would be all OK). This procedure MAY be exported
but I probably wouldn't do that. This will be a private
procedure used only within the module.

What if I want to do the same with my addresses which are treated in a separate module?


New procedure: validateClientName( name )
calls validateName( name : CLIENT_CONSTANT )

New procedure: validateCompanyName( name : CLIENT_CONSTANT )
calls validateName( name : CLIENT_CONSTANT )

I'd then have something like
New procedure: validateAddressStreet( street : ADDRESS_CONSTANT )
calls validateAdress( Address : ADRESS_CONSTANT )

Wouldn't I end up with another function validateAddress identical to validateName? In fact, isn't validateName just encapsulating the %CHECK BIF?

Why not therefore, instead of

validatClientName ( name ); which is self documenting,

// Validate client's name.
%CHECK ( ClientName : CLIENT_NAME_CHARACTERS ); with a comment.

I hope I'm not missing the plot.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.