Function EN Version 5.00

@SearchKeyList

Database

Syntax

@SearchKeyList(HTL1;TEXT2;RETPOS3);

Description

This @Funktion searches a sorted HUGETEXTLIST HTL1 for TEXT TEXT2; it must be fully contained as an element of HUGETEXTLIST HTL1 and, if present, returns the position of TEXT TEXT2 in the HUGETEXTLIST HTL1 in FN RETPOS3 value.
If TEXT TEXT2 is not contained in the HUGETEXTLIST HTL , the position in FN RETPOS3 is returned at which TEXT TEXT2 can be inserted to fit into the sorted HUGETEXTLIST HTL1 zu passen.

This @Function is used to sort HUGETEXTLISTs and for quickly finding elements in a HUGETEXTLIST.

Return value:
If TEXT TEXT2 was found TRUE, otherwise FALSE and in case of an error @ERROR.

Example: @SearchKeyList(HTL1;TEXT2;RETPOS3);

/*Sort the list*/
tl:="de":"ab":"aa":"Ed":"g";
HTL:=@HugeTextList;

n1:=1;
n1e:=@Elements(tl);

WHILE(n1<=n1e)
{
   txt:=@GetListElement(tl;n1);
   Ret:=@SearchKeyList(HTL;txt;RetPos);
   IF(Ret=0)
   {
      HTL:=@InsertListElement(HTL;RetPos;txt);
   }
   @Increment(n1);
}

/*Output of the sorted list HTL*/

n1:=1;
n1e:=@Elements(HTL);

WHILE(n1<=n1e)
{
   txt:=@GetListElement(HTL;n1);
   @LogReport(txt;3);
   @Increment(n1);
}

In this example, the TEXTLIST tl is converted into a sorted HUGETEXTLIST HTL.
This sorted HUGETEXTLIST HTL is then output element by element.

Note : This text was machine-translated and may contain inaccuracies.