× 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 Mike,

You say one of the files is different. Different in what way? Does it have different fields that are used for different purposes?

You mention using an IF statement so I'm expecting something like this:

if FileType='ORANGE';
read ORANGEFIL;
else;
read APPLEFIL;
endif;

And, okay, that will work as far as it goes. But now which fields have been loaded into the program? And what needs to be done differently with the fields from ORANGEFIL vs APPLEFIL? I'm assuming there must be something substantially different about the fields, otherwise you'd have changed ORANGEFIL so that it works exactly the same as APPLEFIL (or whatever your files happened to be named).

If the fields are substantially different and therefore require separate code to handle them, then how can you call one a substitute for the other? AT some point, there must be a common denominator, right?

Personally, I'd try to find the common denominator. Write a service program that encapsulates the differences between the files to (probably the wrong word) "normalize" the file access. Then use that service program instead of reading the file directly.

Make sense?

Mike wrote:
I need to bounce this off you guys to see if there is a better way. This is
bugging every aspect of me and am looking for ideas to simplify my life.

I have two sets of files. Out of the 5 files in the set of files, only one
file in the set is different. So now I have a maintenance nightmare of
having two programs exactly the same (and keep the same) except for the
files they use. Is there a way I can make this one program? I could use a
flag and put an if statement on every read/write/update/delete, but could
there be a better way? The other file is similar, but different enough that
I think it would be best just to maintain two programs.

--
Mike Wills
Midrange Programmer/Analyst

Sick of corporate radio and hungry for something new?
http://thenextgenerationofradio.com


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.