Eric:Thanks, again for the insight. I think you are correct in the order.Here is the original code again...1. if ("$ClientLogo".equals(insert)) {2. replacement = null==logoPicName || "".equals(logoPicName.trim()) ? " ": "<IMG SRC=http://forums.devx.com/archive/index.php/\"" + logoPicName + "\" ALIGN=center>";3. } else if ("$Y0".equals(insert)) {4. replacement = String.valueOf(startYear);5. }What the original programmer intended, I believe, is that if null is equalto null (logoPicName doesn't exist) OR "".equals(logoPicName.trim()) - (logoPicNameis empty) then replace it with the empty string (""). But if it is not nullor empty then we do have the company's logo on file so retrieve it and stickits location into replacement!Thanks again Eric. I appreciate your help very much!Mark Sorteberg"Eric L" <[email protected]> wrote:>>"Mark" <[email protected]> wrote:>>>>Thanks Eric for the help, now for him or any others who want to chime in...>>>>Let's try and make this REAL clear...>>>>First let us make this code easier to read.>>>>1. String insert = $ClientLogo;>>2. If ("$ClientLogo".equals(insert)){>>3. a=b==d||e?f:g;>>4. }else if{>>5. {a=c;>>6. }>>If the order is correct then I believe this is what is happening.>>First (b==d) is evaluated.>>Second (e?f:g) is evaluated.>>Third ((b==d)||(e?f:g)) is evaluated.>>Fourth a=((b==d)||(e?f:g)) is evaluated.>>>I hope this isn't actual production code. If it was, someone was really>looking for job security >>This is what I think, but I might be very wrong.>>b==d||e? would be evaluated first. It is the first operand of ? operatior.> That would mean it would be evaluated as such:>((b==d))||e). If this is true, a is assigned f else a is assigned g. If>I was going to re-write the entire statement, I would do so as follows:>>String Insert= $ClientLogo;>if ("$ClientLogo".equals(insert)) {> if ((b==d)||(e)) then> a=f> else> a=g>}>else> a=c>>Syntactacly it might not be correct, but it is much easier to read. I personally>don't like the ? operatior. I find it can be confusing.>>Eric