FuryCell Posted June 27, 2005 Posted June 27, 2005 (edited) This question has bugged me for quite some time now. If i use code like this will the script keep recalculating the line count or just calculate it once? #Include <Array.au3> #Include <File.au3> Dim $Array[1] $File = FileOpen("C:\Test.txt", 0) For $X = 1 To _FileCountLines($File, "") _ArrayAdd($Array, FileReadLine($File)) Next FileClose($File) _ArrayToClip($Array, 1) (Note:This was just an example to demonstate my point and serves no real purpose. ) Edited June 27, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
FuryCell Posted June 27, 2005 Author Posted June 27, 2005 (edited) Larry said: seems only first time... as it should be... methinksbut, here is one that haunts me...For $n = 1 to 10 MsgBox(4096,"",$n) $n = $n + 1 NextIt makes sense, I guess... I first thought AutoIt would give an error saying that $n was readonly or something...Lar.<{POST_SNAPBACK}>Yes. It appears this holds true for functions too , at least user defined ones. I just made a small script to test it.Global $TestFuncTimes For $X=1 to _TestFunc() ToolTip($X) Next Func _TestFunc() $TestFuncTimes=$TestFuncTimes+1 MsgBox(32,"TestFunc.","Test Func has been executed " & $TestFuncTimes & " times.") Return 10 EndFuncanyway thanks for the feedback Larry. Edited June 27, 2005 by SolidSnake HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.
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