(HP48) Local variable limit
Post: #3
 Brad Barton Member Posts: 188 Joined: Jan 2014
RE: (HP48) Local variable limit
Joe,

Thanks for taking a look. I was just trying something out and ran into this early in the process, so this is more of a code fragment than a program.

Code:
 \<< DUP IF DET 0 == THEN "NO INV" ELSE DUP DET SWAP OBJ\-> DROP \-> dt a b c d e f g h i END \<< 'dt' EVAL 'a' EVAL 'b' EVAL 'c' EVAL 'd' EVAL 'e' EVAL 'f' EVAL 'g' EVAL 'h' EVAL 'i' EVAL\>> END \>>

Obviously there was some mathy stuff in the middle of the program, but this is the debug version. If I put a 3 X 3 matrix on the stack and run this code, I get a "Too few arguments" error both in the calculator and emulator.

If I leave out the local variable 'i' the program runs, but 'h' evals as the 2nd to last element in the matrix. I'm not able to get it to recognize the last local variable. I tried changing it to 'j' and 'm' in case there was a conflict with the imaginary 'i', but it didn't seem to matter.

I'm using the following as a test matrix, but I don't think it matters as long as the determinant isn't zero.

[[ 1 2 3]
[0 8 5]
[7 5 9]]

I'm sure I've made a simple mistake, but I can't find it.