Hi everyone.
When I run the code below, it works fine.
However I have an option at the end of the code to repeat the program ["Press Enter"]
or to end the program ["press "esc"].
The "esc" option works fine.
However if "Enter is chosen, which should bring me back to the start of the program so that
I can enter a new function to solve, when I enter the new function and press "OK"
It tells me I "Entered nothing" in the RequestStr box.
Any help would be greatly appreciated.
Thank you
T Gahan




Code:
Define LibPub funvarsolv()=
Prgm
:Local y1,res,var,i,ab,d,c
:
:Loop
:0→c
:Loop
:1→d
:Try
:RequestStr "enter function",y1,0,ab
:0→d
:
:Else
:© user left input box empty

:[color=blue][b]Text "you entered nothing",0[/b][/color] [color=blue]"This comes up everytime the loop is repeated"[/color]
:ClrErr
:
:EndTry
:If d=0
:Exit
:EndLoop
:© user pressed cancel
:  If ab=0 Then
:      Disp "Press ENTER to  end"
:                subrtine\delay()
:                  DelVar y1,res,var,i,k,ab
:                           Return
:
:EndIf
:
:For i,1,dim(y1),1
:If ord(mid(y1,i,1))≥97 and ord(mid(y1,i,1))≤122 Then
:var:=char(ord(mid(y1,i,1)))
:Exit
:
:ElseIf ord(mid(y1,i,1))≥65 and ord(mid(y1,i,1))≤90 Then
:var:=char(ord(mid(y1,i,1)))
:Exit
:
:ElseIf ord(mid(y1,i,1))≥945 and ord(mid(y1,i,1))≤969 Then
:var:=char(ord(mid(y1,i,1)))
:Exit
:
:ElseIf ord(mid(y1,i,1))≥913 and ord(mid(y1,i,1))≤937 Then
:var:=char(ord(mid(y1,i,1)))
:Exit
:Else
:Disp "not a function"
:EndIf
:EndFor
: expr("Define y1(var) ="&y1)
: res:=exp▶list(solve(y1(#var)=0,#var),#var)
:
:Disp "function: y1("&var&") = ",y1(#var)
:
:Disp "Solution set: "&var&" =",res
:
:subrtine\dlay()
:If k="esc" Then
:1→c
:[color=blue][b]ElseIf k="enter" Then[/b]    [b]"problem here[/b]"[/color]
:0→c
:EndIf
:If c=1
:Exit
:EndLoop
:EndPrgm
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement