title: How can I use a nested while loop in a loop?
body: <p>When I run the code below, it works fine. (TI nspire CAS II calculator)
  However, at the end of the program I give two options, <strong>&quot;Enter&quot;</strong> to repeat the program, <strong>&quot;Esc&quot;</strong> to quit.</p>
  <p>&quot;Esc&quot; works fine.
  However if I pick &quot;Enter&quot;, the RequestStr box pops up again to receive the new input as intended.
  When I enter the input, the program displays <strong>&quot;You entered nothing&quot;</strong> and goes back to the RequestStr box again. I have to press &quot;Cancel&quot; on the RequestStr box to get out of the loop.
  <strong>&quot;You entered nothing&quot;</strong> is part of the error code I am using to intercept the case where the user may click OK without entering anything into the box.
  So basically the program works fine the first time I run it, it is when I choose to rerun it again is when the issue arises.</p>
  <p><strong>CODE</strong></p>
  <pre><code>Define LibPub funvarsolv()=
  Prgm
  :Local y1,res,i,ab,d,c
  :
  :Loop
  :0→c
  :1→d
  :While d =1
  :Try
  :RequestStr &quot;enter function&quot;,y1,0,ab
  :0→d
  :
  :Else
  :© user left input box empty
  :Text &quot;you entered nothing&quot;,0
  :ClrErr
  :
  :EndTry
  :If d=0
  :Exit
  :EndWhile
  
  :© user pressed cancel 
  :  If ab=0 Then
  :      Disp &quot;Press ENTER to  end&quot;
  :                subrtine\delay()
  :                  DelVar y1,i,k,ab
  :                           Return
  :
  :EndIf
  :
  :
  :
  : expr(&quot;Define y1(x) =&quot;&amp;y1)
  : res:=exp▶list(solve(y1(x)=0,x),x)
  :
  :Disp &quot;Solution set: &quot;&amp;var&amp;&quot; =&quot;,res
  :
  :subrtine\dlay()
  :If k=&quot;esc&quot; Then
  :1→c
  :ElseIf k=&quot;enter&quot; Then
  :0→c
  :EndIf
  :If c=1
  :Exit
  :EndLoop
  :EndPrgm
  </code></pre>