Please enable JavaScript to view this site.

 

void = List_LoadFromFile(sListVarName, sFullPathFilename, bCreateIfNeeded)

 

This macro function is used to read the contents of a list from a file on disk at sFullPathFilename.

 

➢The list must already exist; the parameter bCreateIfNeeded refers to the disk file, not to the list.

➢All existing entries of the list sListVarName will be cleared and replaced by the contents of the file sFullPathFilename.

➢The expected format of the text file is UTF-8.

 

We recommend always supplying a valid file name as the sFullPathFilename parameter, rather than relying on this macro function's fallback behavior.

 

The macro code below loads the contents of a text file, processes each entry of the list, and then saves it back.

// load the list of country names override
List_LoadFromFile(sListCountryNames, sFullPathOfTextFile, true)
for nItem = 1 to List_Count(sListCountryNames) step 1
   // make some changes to some or all of the entries
   // ...
endfor
// save it back to file
List_SaveToFile(sListCountryNames, sFullPathOfTextFile)

Creation and Destruction of Lists

 

When using lists, don't forget to 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 178385, last updated on 10-Oct-2026