> Your if statement has four regexp command substitutions, all
> of which will always be executed. All four have side effects
> which change the values of dummy, p, and ver. When your MSIE
> regexp matches, your Mozilla regexp will usually also match.
> You don't know whether Tcl will execute your Mozilla regexp
> command first or second. If it executes the Mozilla regexp
> command second, then p will be "Mozilla" even when it's
> executing the IE code block. The order in which it executes
> the commands might change between different versions of Tcl.

The order of execution has always been consistently left to right,
but the lack of {}s around the if/elseif expressions was definitely
a bug.  The trick is that in using regexp's, all 4 will run (from
left to right), but only ones that have any matches will set the
dummy, p and ver variables.  That means if the 3rd RE matches and
the 4th doesn't, you'll get the values from the 3rd RE ... but of
course you will enter the first if/elseif branch that had a
succeeding case (which could be 1st or 2nd even when the 3rd RE is
the last to set those vars).

  Jeff Hobbs                     The Tcl Guy
  Senior Developer               http://www.ActiveState.com/
        Tcl Support and Productivity Solutions


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of 
your email blank.

Reply via email to