GETI not function on matrices [FIXED IN v.1.4.3]

Bugs in ND1 (report'em, get'em fixed)

GETI not function on matrices [FIXED IN v.1.4.3]

Postby sandraV » Sat May 12, 2012 6:29 am

Hi

The function "GETI" can i not get to function on matrices.
Example input:
2: [[12 45][34 67]]
1: [1 1]
command "GETI"



Br
Sandra
sandraV
 
Posts: 2
Joined: Sat May 12, 2012 6:05 am

Re: GETI not function on matrices

Postby oliver » Sat May 12, 2012 6:50 pm

Hi Sandra,

Thank you for reporting this bug. It will be fixed with the next update.

I guess I broke this with the last update when I renamed a variable.

There're two work-arounds:

A) Use the at function. [[12 45][34 67]] [1 1] at will return 12. It will not keep the original matrix on the stack and increment the index, so it's not a direct GETI replacement.

or

B) Double-tap the edit line and write this JavaScript function:
Code: Select all
function(m,v) {
    window.x = m;
    return ME.matrix.GETI(m,v);
}

Enter it and store it as 'geti'.

Now, geti will work like GETI is supposed to. A user function, it will only work in the folder it's defined in.
If that folder is called, say, "Mine", then Mine.geti will work from any folder.

I'm planning on releasing the next update later this month. I hope this helps until then.

Thank you!
oliver
Site Admin
 
Posts: 433
Joined: Sat May 01, 2010 2:11 pm

Re: GETI not function on matrices

Postby sandraV » Sun May 13, 2012 7:53 am

Great thanks!!
For the fast answer and the work-arounds

/Sandra
sandraV
 
Posts: 2
Joined: Sat May 12, 2012 6:05 am

Re: GETI not function on matrices

Postby oliver » Sun May 13, 2012 3:16 pm

Sandra,

This is pretty elementary and was easy to fix, so I decided to make it a restore fix.

While connected to the Internet, please go to the Definition tab, scroll to the bottom, and tap Restore and then Restore Calculator.

This will pick a fix and make GETI work, with no need for one of the work-arounds above.

Cheers.

P.S. In case you're interested to know how this works: the calculator is "ROM-less" and can be enhanced with injected code. Even as a user you can overwrite and fix stock functions. The new restore file includes injection code like this:
Code: Select all
ME.matrix.GETI_broken = ME.matrix.GETI;
ME.matrix.GETI = function(m,v) {
    window.x = m;
    return ME.matrix.GETI_broken(m,v);
};

which provides a temporary fix, just as per above. You can see this code on the JS Injection page, which appears under Definition, once you enable it in the Settings app.
oliver
Site Admin
 
Posts: 433
Joined: Sat May 01, 2010 2:11 pm


Return to Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron