I've been working on a series of programs that use inString(. When I use it, it gives me a syntax error, and when I hit 2 to goto the error, it simply shows the name of the program as the error. Here's my code:

Code:
Ans->Str6
inString(Str6,"X")->N
If N
Then
expr(sub(Str6,1,N-1))->L1(1)

I entered "4X^2" (Not in mathprint). Is there somewhere I'm using the command wrong? Is it a bug in the interpreter? Thanks.
That is the correct use of the inString() command. The only issue I see is if the input was not a string, but "4X^2" is a string. In fact, I went ahead and tried out your code, and it works fine. Make sure you put quotes around your input, and make sure none of the tokens are spelled out with letters, which can sometimes happen if you are exporting your code from an editor.
Also, it is obvious that this code is not your entire program, maybe the error is coming from somewhere else in your program, but that part should be fine.
  
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