Post Reply 
[SOLVED] Bug with INSTRING
10-27-2016, 06:41 AM (This post was last modified: 10-27-2016 06:45 AM by toml_12953.)
Post: #5
RE: Bug with INSTRING
(10-26-2016 08:37 AM)CH3791 Wrote:  Hello,

When I put INSTRING("√7","√") directly into CAS, it returns 1 as expected.

However when I put the exact same thing into programs, it returns 0. CAS or non-CAS, it doesn't matter.
Code:
EXPORT norm_instring_bug(expression)
BEGIN
  return instring(string(expression),"√");
END;

#cas
cas_instring_bug(expression):=
BEGIN
  return instring(string(expression),"√");
END;
#end

It might have something to do with Prime auto-adding spaces, which I found to have caused some issues during my testing. For example, Prime changes "√" to " √ ". If we now calculate INSTRING("√7"," √ "), it returns 0.

When I put in the following:
Code:
EXPORT norm_instring_bug(expression)
BEGIN
  RETURN INSTRING(STRING(expression),"√");
END;

I get 2 in RPN mode when I enter "√7". I tried with all capitals as well as lowercase keywords. I get 2 every time.
Tom L

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
[SOLVED] Bug with INSTRING - CH3791 - 10-26-2016, 08:37 AM
RE: Bug with INSTRING - StephenG1CMZ - 10-26-2016, 01:02 PM
RE: Bug with INSTRING - Han - 10-26-2016, 06:49 PM
RE: Bug with INSTRING - toml_12953 - 10-27-2016 06:41 AM
RE: Bug with INSTRING - CH3791 - 10-27-2016, 09:36 AM
RE: Bug with INSTRING - StephenG1CMZ - 10-27-2016, 01:47 PM
RE: Bug with INSTRING - CH3791 - 10-28-2016, 07:10 AM
RE: [SOLVED] Bug with INSTRING - Jan_D - 11-19-2016, 09:11 PM
RE: [SOLVED] Bug with INSTRING - CH3791 - 11-21-2016, 10:38 AM
RE: [SOLVED] Bug with INSTRING - Jan_D - 11-21-2016, 03:45 PM



User(s) browsing this thread: 1 Guest(s)