Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #37980

Logical conundrums if () else if()

Newsgroups comp.lang.javascript
Date 2019-12-28 00:40 -0800
Message-ID <cd84bfc2-63ac-4a4f-bd76-9b144035b9ba@googlegroups.com> (permalink)
Subject Logical conundrums if () else if()
From Jonas Thörnvall <jonas.thornvall@gmail.com>

Show all headers | View raw


How can two if statements that work perfectly standalone as single statments.
Make outcome that differs when you put in, an else if statement to only execute one of them. The below statements have the statement with heavier conditioning first so not the second statement gets executed. Because both satisfy the noneboolean condition.

I probably done some very no no thingy.

 	

if (EDITEND<SELEND && document.getElementById("lockedit").checked){
  SELLENGTH=SELEND-SELSTART;
  document.getElementById("SB").value=EDITSTART+SELLENGTH;
  document.getElementById("EB").value=SELEND;
} else if (EDITEND<SELEND){ document.getElementById("EB").value=SELEND;}

Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Logical conundrums if () else if() Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-12-28 00:40 -0800
  Re: Logical conundrums if () else if() "R.Wieser" <address@not.available> - 2019-12-28 12:21 +0100
    Re: Logical conundrums if () else if() Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-12-28 05:32 -0800
      Re: Logical conundrums if () else if() "R.Wieser" <address@not.available> - 2019-12-28 19:10 +0100
        Re: Logical conundrums if () else if() Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-12-28 12:16 -0800
          Re: Logical conundrums if () else if() "R.Wieser" <address@not.available> - 2019-12-29 08:52 +0100
          Re: Logical conundrums if () else if() Arno Welzel <usenet@arnowelzel.de> - 2019-12-30 21:35 +0100
            Re: Logical conundrums if () else if() Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-12-30 12:42 -0800
  Re: Logical conundrums if () else if() "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-12-28 09:37 -0800
    Re: Logical conundrums if () else if() Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2019-12-29 11:43 +0100
      Re: Logical conundrums if () else if() "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2019-12-29 08:14 -0800
  Re: Logical conundrums if () else if() Soviet_Mario <SovietMario@CCCP.MIR> - 2020-01-18 21:06 +0100
    Re: Logical conundrums if () else if() Soviet_Mario <SovietMario@CCCP.MIR> - 2020-01-19 01:22 +0100

csiph-web