Re: Autoit V3 to slow? autoit2 was faster!?!

larrydalooza <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
--- In [email protected], "Lüth, Carsten" <c.lueth@...> wrote:
>
> Hello,
>  
> thx for all replys!
>  
> execution time for the same search:
> autoit version 2 = ~2 seconds! 
> autoit version 3 = ~11 seconds!
>  
> How to make Autoit 3 faster???
>  
> ;NEW Autoit-3-Script ~~~~~~~~~~~
> #include <file.au3>
> $search = InputBox("Search in TNSNAMES.ORA", "Please enter Number -
3 digits
> - you want to search:")
> $begin = TimerInit()
> $CountLines = _FileCountLines( "TNSNAMES.ORA" )
> $search = "NDL0" & $search & ".world"
> $line=0
> while $line < $CountLines
>     $line = $line + 1
>     $text = FileReadLine ( "TNSNAMES.ORA" , $line )
>     $result = StringInStr ( $text, $search )
>     if $result > 0 then exitloop
> wend
> $dif = TimerDiff($begin)
> MsgBox(0,"Time Difference",$dif)
> if $result = 0 then 
>  MsgBox ( 0, "Search", "Nothing found!" )
> Else 
>  MsgBox ( 0 , "Search", "NDL0xxx.world found in line " & $line )
> Endif
> ;~~~~~~~~~~~~~~~~~~~~~~

try this...

$search = InputBox("Search in TNSNAMES.ORA", "Please enter Number - 3
digits - you want To search:")

$begin = TimerInit()

$search = "NDL0" & $search & ".world"

$line = 0
While 1
	$text = FileReadLine("TNSNAMES.ORA")
	If @error Then ExitLoop
	$line += 1
	If StringInStr($text, $search) Then
		$dif = TimerDiff($begin)
		MsgBox(0, "Time Difference", $dif)
		MsgBox(0, "Search", "NDL0xxx.world found in line " & $line)
		Exit
	EndIf
WEnd
MsgBox(0, "Search", "Nothing found!")
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.