|
Sorry, I'm a bit behind on my reading... Frank, if you change the "EQ" to "NE" in your second example and place an ELSE statement before your MOVE statement, then you will have functionally identical code snippets. You can find more information on this by going to Google and entering "DeMorgan's Theorem"... (the complement of a conjunction is the disjunction of the complements)... Digital electronics guys know this stuff, but it is very useful to software guys too. Depending on your data, you can determine which method (AND or OR) is better. If the majority of the data can "short-circuit" the expression, that is the way I'd code it. (Keeping in mind clarity and maintainability, of course.) A "short circut" occurs if you determine the truth of the expression without needing to evaluate the complete expression. If you have a series of "ANDs", and you hit a false condition, you don't have to continue to evaulate the whole thing. There is a comparable situation when using "ORs". date: Thu, 11 Dec 2003 15:10:19 -0600 from: fkany@xxxxxxxxxxxxxxxxxx subject: IFEQ ANDEQ vs IFEQ OREQ Will Example 1 and Example 2 have the same effect? Example 1: C FHSSUF IFEQ 'XP' C FHSSUF OREQ 'AC' C FHSSUF OREQ 'GS' C MOVEL$MSG,225 #EMSG P C END Example 2: C FHSSUF IFEQ 'XP' C FHSSUF ANDEQ'AC' C FHSSUF ANDEQ'GS' C MOVEL$MSG,225 #EMSG P C END Thanks, Frank ========================= William Washington III Njia Systems Incorporated w.washington3@xxxxxxxxxxxxxxx 312-719-0519 =========================
As an Amazon Associate we earn from qualifying purchases.
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.