Andre Posted February 24, 2005 Share 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! Link to comment Share on other sites More sharing options...
SlimShady Posted February 24, 2005 Share Posted February 24, 2005 Where is the variable "$ConfigFile" declared? Did you verify the file path and see if the file exists? Link to comment Share on other sites More sharing options...
Andre Posted February 24, 2005 Author Share 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! Link to comment Share on other sites More sharing options...
SlimShady Posted February 24, 2005 Share Posted February 24, 2005 No offense, but that's usually the case. Happened to me before. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now