Jump to content

acada

Members
  • Posts

    4
  • Joined

  • Last visited

acada's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Thank you for kicking me in... I have used your idea and rewrote it little bit: $j = 1 while $j = 1 $rnd = Random(1,10000,1) If check($rnd) = 0 Then $file_1 = FileOpen(@WorkingDir&"\container.txt",1) FileWriteLine($file_1,$rnd) FileClose($file_1) EndIf WEnd Func check ($number) $check = 0 $file_2 = FileOpen(@WorkingDir&"\container.txt",0) $compare = FileRead($file_2) If $number = StringInStr(String($compare),String($number)) Then $check = 1 FileClose($file_2) Return $check EndFunc You know, I needed the continuous first loop. And you are right. Ther is no more leaking...
  2. Hi there I have problem with repeat file write/read. I need to generate numbers from 1 to 10000 and use them somewhere else in script. I need to do not use them more then once. So I created a file, where will be the number written after it is used and function, which check this flie and returns if the number waws used before. The problem is that this script is causing memory leaks. In few seconds the RAM usage is huge... Can anybody helps tell me whats wrong? BTW the problem occurs only when started with empty container.txt file. If the file is full of numbers (I mean full from 1 to 10000 and sorted ascending), there is no memory leak. $j = 1 while $j = 1 $rnd = Random(1,10000,1) If check($rnd) = 0 Then $file_1 = FileOpen(@WorkingDir&"\container.txt",1) FileWriteLine($file_1,$rnd) FileClose($file_1) EndIf WEnd Func check ($number) $check = 0 $file_2 = FileOpen(@WorkingDir&"\container.txt",0) While $j = 1 $line = FileReadLine($file_2) If @error = -1 Then ExitLoop If $number = $line Then $check = 1 WEnd FileClose($file_2) Return $check EndFunc
  3. O my... I should have known it. Now it is working like charm. I will try FileInstall to copy this library whenever the utility is executed from. The whole script is for massive remote deploying of installation (no it is is not a virus, nor spyware) using UDP.
  4. Hi I have problem with capturing images on Win 2000 and older. I am using these commands: CODE#include <A3LScreenCap.au3> ; Capture full screen _ScreenCap_Capture("C:\Image1.jpg") ; Capture region _ScreenCap_Capture("C:\Image2.jpg", 0, 0, 796, 596) The error I get on Win 2000 is: Line 0 (File "<my_file>"): Return SetError($aResult[0], 0, $aResult[1]) Return SetError($aResult^ ERROR Error: Subscript used with non-Array variable. The very same example script runs fine on the WinXP. I have tracked the problem to the A3LGDIPlus.au3 library, because no other lib contains the "Return SetError($aResult[0], 0, $aResult[1])". What can be the problem? I have latest autoit and latest a3lib...
×
×
  • Create New...