HP Forums
COMANDO MAP - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: COMANDO MAP (/thread-6886.html)



COMANDO MAP - ivan - 09-19-2016 08:56 PM

good afternoon everyone, I want to use the "map " command in a program, but when I boot an error check .
This is the code I have:

EXPORT PRUEBA()
BEGIN
LOCAL a:={},m,X;X:=CAS.X;
a:={1,23,45,10,0};
m:=map(a,X→X<10);
m;
END;

I can say where the bad and what is the solution , thanks for your reply .


RE: COMANDO MAP - roadrunner - 09-20-2016 01:40 AM

If you are using version 10637 try:

EXPORT PRUEBA()
BEGIN
local a:={},m,X; X:=CAS.X;
a:={1,23,45,10,0};
m:=map(a,"X→X<10");
m;
END

-road


RE: COMANDO MAP - jrozsas - 09-20-2016 09:27 AM

(09-20-2016 01:40 AM)roadrunner Wrote:  If you are using version 10637 try:

EXPORT PRUEBA()
BEGIN
local a:={},m,X; X:=CAS.X;
a:={1,23,45,10,0};
m:=map(a,"X→X<10");
m;
END

-road

Do not Forget ; after END


RE: COMANDO MAP - Carlos295pz - 09-20-2016 05:41 PM

When CAS functions are used, it is valid to use the expressions in double quotes.

EXPORT PRUEBA()
BEGIN
local a:={},m;
a:={1,23,45,10,0};
m:=map(a,"x→x<10")
END;


RE: COMANDO MAP - hpfx - 09-20-2016 07:17 PM

By the way,
Please note, you can alse use user function, like

Code:

myfct(z)
BEGIN
// you can use anything you want
// #cas function and string manipulation more easily
RETURN z<10;
END;

EXPORT PRUEBA()
BEGIN
local a:={},m;
a:={1,23,45,10,0};
m:=map(a,"x→myfct(x)");
END;