Jump to content

what to do when reach endof


Recommended Posts

HELL I AM RECVING TEXT FROM A THIRD PARTY PROGRAM

I AM WRITING THE TEXT INTO A FILE

AT THE SAME TIME II AM READING THE FILE TO PROCESS THE DATA

I AM BUILDING TRAKER SOFTWARE

THE PROBLEM IS WHEN I REACH THE EOF FILE

; just experimenting with

#include <File.au3>

opt("wintitlematchmode",2)

global $table = "Play"

$file = ("data/table")

$file2 = ("data/table2")

iniWrite($file2,"a","a","O" )

FileDelete ($file)

$text = ControlGettext ( $table, "", "RichEdit20W1")

while 1

FileDelete ($file)

sleep(2000)

IniWrite($file,'a','a','test')

FileOpen($file, 0)

For $i = 0 to _FileCountLines($file)

DirRemove("data/table2", 1)

fileWrite($file,$text )

$line = FilereadLine($file, $i)

if StringInStr($line,"leniewski10 wins") then

msgbox(0,'','the line ' & $i & ' is ' & $line,1)

EndIf

Next

IniDelete($file,'a','a')

sleep(1000)

$varxx = ("data/table2")

iniWrite($varxx,"a","a",$i)

msgbox("","test","waiting for next line",1)

wend

Link to comment
Share on other sites

Explain more, what problem when you reach EOF? Every file has a EOF, what's wrong with reaching it?

Also try to put your code inside an autoit tag

the problem is my file is alway updateing real time

so when i reach the endof

the scripts restarts

but it aint realy the eof cos with in 30 seconds the files has more lines

all im trying to do is read the file then when it comes to the eof save what ever line its on

delete the old text reopen the file ,copy in the new text, carry on from where it left of

here is my code im working on im almost there just not yet

;----------------------------------------------------------------------------------------------------------------------------------------

; just experimenting with

#include <File.au3>

opt("wintitlematchmode",2)

global $table = "Play"

$file = ("data/table")

$file2 = ("data/table2")

iniWrite($file2,"a","a","O" )

$Text = ControlGettext ( $table, "", "RichEdit20W1")

$iFile = FileOpen($file, 2);<<<<<<<<<<<<<<<<<<<<<<<<<

For $i = 0 To _FileCountLines($iFile)

FileWrite($iFile, $Text)

sleep(1111)

$Line = FileReadLine($iFile, $i)

if StringInStr($Line,"LENIEWSKI10") then

msgbox(0,'','the line ' & $i & ' is ' & $Line,1)

endif

Next

; MsgBox(1,"waiting!!!!!!!!","looking good")

; iniWrite($file2,"a","a",$i)

Link to comment
Share on other sites

could any 1 please help me

im still stuck

i have bin trying now for 48 hours

and got no further

i am trying to read from a file wich i am updateing at the same time

the problem is when i come to the eof

what i want to do is save the the line number when i come to the end of in a ini form iniWrite($file2,"a","a",$i)

so now when the scripts restarts it carry on from the last line sound easy enought

[autoit; just experimenting with

#include <File.au3>

opt("wintitlematchmode",2)

global $table = "Play"

$file = ("data/table")

$file2 = ("data/table2")

$iFile = FileOpen($file, 2);<<<<<<<<<<<<<<<<<<<<<<<<<

iniWrite($file2,"a","a","O" )

$Text = ControlGettext ( $table, "", "RichEdit20W1")

$startat = IniRead($file2,"a","a","" )

For $i = $startat To _FileCountLines($file)

$Line = FileReadLine($iFile, $i)

if StringInStr($Line,"Dealing down cards") then

msgbox(0,'','the line ' & $i & ' is ' & $Line,1)

endif

Next

iniWrite($file2,"a","a",$i )

MsgBox(1,"waiting for next card","looking good")

iniWrite($file2,"a","a",$i) [/autoit]

i carnt see why it wont work but it just jumps to the last message - ,"waiting for next card","looking good

please can some one help me

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...