× 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.



Hi David

Well, originally, you wrote:

So, if the flag were dependent upon say, the client type, I could have :

clientFlag = getClientFlag ( clientType )

and in getClientFlag :

If clientType = TYPE_THIS....etc
If clientType = TYPE_THAT....etc

Maybe the names you chose gave me the wrong idea but for any kind of look up
like this I would almost never do it in code, I'd have a table instead (by
table I mean a physical file so there's no misunderstanding).

In your example you would set up a table that had the client type and the
flag so in your getClientFlag function you'd simply look up the client type
and return the flag.

ClientType CHAIN ClientTypes

Or

SELECT clientFlag from ClientTypes WHERE TYPE = ?

There's no hard coding because you simply add any new client flags to the
table.

That said, I really don't get the distinction between a type and a flag if
it's a one to one relationship - presumably this is a too simplistic example
that's gone bad.

Regards
Evan Harris


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of David FOXWELL
Sent: Wednesday, 24 March 2010 10:45 p.m.
To: Midrange Systems Technical Discussion
Subject: RE: when to use a function or file for information

-----Message d'origine-----
[mailto:midrange-l-bounces@xxxxxxxxxxxx] De la part de Evan Harris

Don't you see any resemblance to a *table* there at all ?

No. Feel free to enlighten me.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.