Please enable JavaScript to view this site.

 

void = List_SaveToFile(sListVarName, sFullPathFilename)

 

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

 

➢The text file generated is UTF-8.

 

A filename without a drive-letter path is saved in the application server’s MacroFiles subfolder. A full drive-letter path is used as supplied. The file is created or overwritten, but its destination folder must already exist.

 

We recommend supplying the full drive-letter path of the intended file, particularly when also using List_LoadFromFile, whose default folder is DefaultFiles.

 

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 178390, last updated on 18-Nov-2026