Post Reply 
How to check for and trap a CAS error in a program?
11-30-2018, 03:27 PM
Post: #1
How to check for and trap a CAS error in a program?
I have the following sample program in the emulator, latest ROM.[/quote]
PHP Code:
EXPORT FOO()
BEGIN
  LOCAL i
p;
  PRINT();
  
:= 0;
  
IFERR
    
WHILE DO
      
:= CAS.part("sin(45)"i);
      PRINT(
p);
      
:= 1;
    
END;
  
THEN
    
PRINT("Error at part "+i);
  ELSE
    PRINT(
"No error");
  
END;
  RETURN 
1;
END
When I run it I get the following on the terminal:
Quote:sin
45
part(sin(45),i_,i_)
Error: Bad Argument Value
No error

As you can see from the messages, the IFERR error handler didn't trap the CAS error. Is there another 'official' way to do this?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
How to check for and trap a CAS error in a program? - BruceH - 11-30-2018 03:27 PM



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