Post Reply 
How to remove an item from a list? [SOLVED]
10-22-2016, 09:07 AM
Post: #2
RE: How to remove an item from a list?
I don't think there is a built-in command to remove an item from a list.
Here is a small program to do it :
Code:
EXPORT Remove(l,n)    //remove item n from list l
BEGIN
 LOCAL s:=SIZE(l);
 CASE
  IF n==1 THEN l({2,s}) END;
  IF n==s THEN l({1,s-1}) END;
  IF n>1 AND n<s THEN CONCAT(l({1,n-1}),l({n+1,s})) END;
  DEFAULT l END;
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to remove an item from a list? - Didier Lachieze - 10-22-2016 09:07 AM



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