| 1 | ###User Defined Function###
|
|---|
| 2 | _FileWriteFromArray
|
|---|
| 3 |
|
|---|
| 4 | ###Description###
|
|---|
| 5 | Writes 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@@
|
|---|
| 28 | Success: 1.
|
|---|
| 29 | Failure: 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###
|
|---|
| 39 | If a string path is provided, the file is overwritten and closed.
|
|---|
| 40 | To 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.
|
|---|
| 41 | If 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@@
|
|---|