ArrayFilePut

Writes a one-dimension array to a file.

Syntax:

ArrayFilePut (filename, array [, write-undef])

Parameters:

(s) filename: path and file name of the file to create.

(a) array: specifies an array.

(i) write-undef: [optional] see below.

Returns:

(i)  Returns the number of bytes written to the file.

 

If "write-undef" is @TRUE, then uninitialized elements in the array will be written as blank lines in the file. If "write-undef" is @FALSE, then uninitialized elements will not be written.

This function writes a one-dimension array to a file, one element per line. If "filename" exists, it will be overwritten.

By default, each line in the file will be terminated with a CR/LF. This can be changed using IntControl 53.

 

Example:

outputfile = "c:\temp\output.txt"
filelist = FileItemize(StrCat(DirWindows(0),"*.*"))
array = Arrayize(filelist,@TAB)
ArrayFilePut(outputfile, array, @TRUE)
Message("Done","one-dimension array written to file")

See Also:

IntControl 40, Arrays, ArrayFileGet, ArrayFileGetCsv, ArrayFilePut, ArrayFilePutCsv, ArrayFromStr, ArrayInsert,  ArrayItemize, Arrayize, ArrayLocate, ArrayRedim, ArrayRemove, ArrayReverse, ArraySort, ArraySwapElements, ArrayToStr, ArrDimension, ArrInfo, ArrInitalize, Drop