|
From: John H Meyers on 9 Apr 2008 03:44 On Tue, 08 Apr 2008 23:44:32 -0500: [use a library, if installed, assuming UserRPL] Since a library may be stored in any port, perhaps :&:nnn VTYPE should be tested (this seems to error on HP49/50 "iff" library nnn is not found, though I don't know whether this is guaranteed foolproof, including against a library just stored but not yet installed); it also doesn't error on HP48G[X], on which you just get -1 result, and it's also theoretically possible to create a variable named 'nnn' (anything "nnn" S~N STO) One could also just plunge ahead and execute the first needed library function, by number, e.g. #LLLNNNh LIBEVAL (error #4 indicating that the function wasn't found). Or dynamically compile a "visible" command name e.g. "::WXYZ" STR\-> DTAG and test for resulting object type; this is slower, however, and also compiles a ROMPTR (type 14) only if library is also attached, which not all libs need be (nor do all have any "visible" commands, etc.) Note that whenever IFERR is used, flag -55 decides whether last-saved user command arguments are restored after an error, so one may need either to set or test the flag state, to guarantee absence of a flag-dependency bug (even HP has published programs neglecting that, including APLY in the 48G AUR, also embedded in the HP48G[X] via TEACH) [r->] [OFF]
|
Pages: 1 Prev: Solving equations with ln() Next: Simple? SysRPL question |