Please enable JavaScript to view this site.

 

str = List_GetFullText(sListVarName)

 

This macro function is used to get all the elements of a list as a string where each string is separated by a return.

 

Bulk search for text

 

One use of the function List_GetFullText is to quickly search for text within the entire list, without having to loop through each element of the list. The macro code below checks if there is an override entry for the holidays set of ID 20322, for example.

// load the list of country names override
List_LoadFromFile(sListCountryNameOverrides, sFileCountryNames, true)
sFullText = List_GetFullText(sListCountryNameOverrides)
if Pos('20322', sFullText) > 0
   // the string 20322 is somewhere in sListCountryNameOverrides
   // ...
endif

Assignment between lists

 

Another use of the function List_GetFullText is to quickly copy the text contents of one list into another.

// copy the contents of sListA into sListB
sFullText = List_GetFullText(sListA)
List_SetFullText(sListB, sFullText)

When using lists, don't forget to always use the function List_Create to create your list at the top of the macro, and then the function List_Destroy to destroy it at the end of the macro.

 

See also: list macro functions.

 


Topic 178400, last updated on 18-Apr-2020