﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
294	Fix for _FileFreadToArray()	GEOSoft	Gary	"Fixes the situation where the file contains no @LF
NOTE: This also includes my version with a default value for $aArray, Reason= It can be called without pre-declaring the array.  You just need $MyArray = _FileReadToArray(""My\File\Path.ext"")  My feelings won't be hurt if that's removed.
{{{
Func _FileReadToArray($sFilePath, $aArray = """")
   Local $hFile
   $hFile = FileOpen($sFilePath, 0)
   If $hFile = -1 Then ;; unable to open the file
      SetError(1)
      Return 0
   EndIf
   $aFile = FileRead($hFile, FileGetSize($sFilePath));; Read the file and remove trailing white spaces
   $aFile = StringStripWS($aFile, 2)
   FileClose($hFile)
   If StringInStr($aFile, @LF) Then
      $aArray = StringSplit( StringStripCR($aFile), @LF)
   ElseIf StringInStr($aFile, @CR) Then ;; @LF does not exist so split on the @CR
      $aArray = StringSplit( $aFile, @CR)
   Else ;; unable to split the file
      SetError(1)
      Return 0
   EndIf
   Return $aArray
EndFunc  ;<==> _FileReadToArray()

}}}
"	Bug	closed	3.2.13.0	AutoIt	3.2.12.0	None	Fixed	File.au3	
