HP Forums

Full Version: COMANDO MAP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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 .
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
(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
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;
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;
Reference URL's