Post Reply 
Bug? Tricky syntax? Finding items in a list
11-03-2017, 04:19 PM
Post: #3
RE: Bug? Tricky syntax? Finding items in a list
This is a little faster

Code:

EXPORT ListFIND2(LST,ITEM)
BEGIN
  LOCAL X,Y;
  LOCAL LSTPOSNS={};

  WHILE X:=POS(LST,ITEM) DO
    LSTPOSNS(0):=(Y:=X+Y);
    LST:=LST({X,SIZE(LST)}+1)
  END;

  RETURN LSTPOSNS;

END;

Viga C | TD | FB
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Bug? Tricky syntax? Finding items in a list - Carlos295pz - 11-03-2017 04:19 PM



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