d89-mlt@sm.luth.se (Morgan Lindqvist) (06/01/91)
Hello World! This article have two parts, first some information and then a question. The information about the errorhandler. If you want a program (that you writes) to say MYPROG Error: Too Few Arguments And the ERRN (error number) not to bee #70000h. The program must reside in a library, and it must bee written in internal code e.i. NOT RPL. (ERRN becomes #70000h if you give a string as input to DOERR ) Example: Sdup @ A program that DUP a string 02d9d @ Program start 18ece @ Saves last RPL name e.i 'Sdup', @ verifies depth >=1 and @ checks argument type 0400d @ <3h> internal type of a string 02d9d @ Program start 03188 @ Internal DUP 0312b @ Program end 0312b @ Program end The difference between this and a normal internal program is the Save last... instruction, it doesn't just save 'Sdup' it saves the entire stack also. So if you call #10f86h (invalid syntax) in the inner program the errorhandler first restores the stack and then displays Sdup Error: Invalid Syntax Now too the question. How do one do if one want to display a local Xlib error. e.i. ERRN=#64001h error number 1 in library 640h (1600d). DOERR doesn't restore the stack or display the RPL name. Opinions are very welcome. Morgan Lindqvist d89-mlt@sigma.sm.luth.se