Ticket #2721: _FileWriteFromArray.txt

File _FileWriteFromArray.txt, 1.5 KB (added by mLipok, 6 years ago)
Line 
1###User Defined Function###
2_FileWriteFromArray
3
4###Description###
5Writes an array to a specified file
6
7###Syntax###
8#include <File.au3>
9_FileWriteFromArray ( $sFilePath, Const ByRef $aArray [, $iBase = Default [, $iUBound = Default [, $sDelimiter = "|"]]] )
10
11
12###Parameters###
13@@ParamTable@@
14$sFilePath
15        Path of the file to write to, or a file handle returned by <a href="../functions/FileOpen.htm">FileOpen()</a>.
16$aArray
17        The array to be written to the specified file.
18$iBase
19        [optional] Start array index to read, normally set to 0 or 1. Default is the Default keyword.
20$iUbound
21        [optional] Set to the last record you want to write to the File. Default is the Default keyword (whole array.)
22$sDelimiter
23        [optional] Delimiter character(s) for 2-dimension arrays. Default is "|".
24@@End@@
25
26###ReturnValue###
27@@ReturnTable@@
28Success:        1.
29Failure:        0 and sets the @error flag to non-zero.
30@error: 1 - Error opening specified file
31        2 - $aArray is not an array
32        3 - Error writing to file
33        4 - $aArray is not a 1D or 2D array
34        5 - Start index $iBase is greater than the $iUbound parameter
35@@End@@
36
37
38###Remarks###
39If a string path is provided, the file is overwritten and closed.
40To use other write modes, like append or Unicode formats, open the file with <a href="../functions/FileOpen.htm">FileOpen()</a> first and pass the file handle instead.
41If a file handle is passed, the file will still be open after writing.
42
43
44###Related###
45_FileReadToArray
46
47
48###Example###
49@@IncludeExample@@