Post Reply 
COMANDO MAP
09-19-2016, 08:56 PM
Post: #1
COMANDO MAP
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 .
Find all posts by this user
Quote this message in a reply
09-20-2016, 01:40 AM
Post: #2
RE: COMANDO MAP
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
Find all posts by this user
Quote this message in a reply
09-20-2016, 09:27 AM
Post: #3
RE: COMANDO MAP
(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

Leo

Visit this user's website Find all posts by this user
Quote this message in a reply
09-20-2016, 05:41 PM
Post: #4
RE: COMANDO MAP
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;

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
09-20-2016, 07:17 PM
Post: #5
RE: COMANDO MAP
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;
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 3 Guest(s)