Andre 0 Posted February 24, 2005 (edited) Hi this is workingDim $aRecords If Not _FileReadToArray("c:\tmp\a\test.ovpn",$aRecords) Then MsgBox(4096,"Error", " Error reading log to Array error:" & @error) Exit EndIf For $x = 1 to $aRecords[0] Msgbox(0,'Record:' & $x, $aRecords[$x]) NextThis not :Func Modify_ConfigFile() Dim $ConfigFile_Array FileInstall('c:\download\openvpn\openvpn.ovpn', $DefInstallDir & '\config\',1) _FileReadToArray($DefInstallDir & '\config\' &$ConfigFile, $ConfigFile_Array) $FileHandle = FileOpen($DefInstallDir & '\config\' & $ConfigFile,2) For $x = 1 To $ConfigFile_Array[0] If StringInStr($ConfigFile_Array[$x],'ovpnxxxx_crt.pem') Then $ConfigFile_Array[$x] = 'cert ' & $Crt_File ElseIf StringInStr($ConfigFile_Array[$x],'ovpnxxxx_key.pem') Then $ConfigFile_Array[$x] = 'key ' & $Key_File EndIf $ConfigFile_Array[$x] = StringStripCR($ConfigFile_Array[$x]) FileWriteLine($FileHandle, $ConfigFile_Array[$x]) Next FileClose($FileHandle) EndFuncError : ==> Subscript used with non-Array variable.: For $x = 1 To $ConfigFile_Array[0] For $x = 1 To $ConfigFile_Array^ ERRORCan't find the error AndreEdit : Can't remember having this error in the beta Edited February 24, 2005 by Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Share this post Link to post Share on other sites
SlimShady 1 Posted February 24, 2005 Where is the variable "$ConfigFile" declared? Did you verify the file path and see if the file exists? Share this post Link to post Share on other sites
Andre 0 Posted February 24, 2005 Yes, Seems that _FileReadToArray($DefInstallDir & '\config\' &$ConfigFile, $ConfigFile_Array) won't work because the file is not there ;( Dumb Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Share this post Link to post Share on other sites
SlimShady 1 Posted February 24, 2005 No offense, but that's usually the case. Happened to me before. Share this post Link to post Share on other sites