AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

(bump) reading non-existant file & line # under Win_XP

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Tue Mar 09, 2010 5:38 am    Post subject: (bump) reading non-existant file & line # under Win_XP Reply with quote

This code works as written under Win_vista32, that is pausing if the files does not exist or of the current line does not exist.

but instead it automatically increments under Win_xp and %line% seems to have valid data.

Why? The purpose of the scripts is proof of concept of interprocess communication across computers. (yes I know of wm_messages for the same computer)

the first script reads a file looking for new lines
if there is no line I get the text that includes _____ underscores

Code:
#singleinstance force
#Persistent

;reader
CoordMode, ToolTip, screen
CoordMode, Mouse, screen


filename=tester1.txt

x=600
y=400
b_index=1

loop
{
 FileReadLine, line, %filename%, %b_index%

 b_errorlevel:=errorlevel ; so I can see the value using listvars
;listvars
;msgbox
 if b_errorlevel = 0
 {
    tooltip, %b_index%:%line% , x, y , 1
    b_index++
 }
 else
    tooltip, %b_index%:__________ , x, y , 1

  sleep, 200
}
return

+esc::exitapp


f12::reload

the 2nd script appends a line to the file that the 1st reads
Code:
#singleinstance force
#Persistent

; writer
CoordMode, ToolTip, screen
CoordMode, Mouse, screen
b_index=1

filename=tester1.txt

x=600
y=400
b_index=1

settimer, fred, 200

return

fred:
mousegetpos, x, y
Fileappend, test%b_index% x%x% Y%Y%`n, %filename%
b_index++
return

loop
{
Fileappend, test%a_index%`n, %filename%
  sleep, 200
}
return

^esc::exitapp

f11::reload


Last edited by Leef_me on Thu Mar 11, 2010 8:02 pm; edited 2 times in total
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Thu Mar 11, 2010 8:02 pm    Post subject: Reply with quote

Bump
Back to top
View user's profile Send private message
OceanMachine



Joined: 15 Oct 2007
Posts: 780
Location: England

PostPosted: Thu Mar 11, 2010 8:43 pm    Post subject: Re: (bump) reading non-existant file & line # under Win_ Reply with quote

Leef_me wrote:
...proof of concept of interprocess communication across computers..


Have you seen this? Might be easier.

With regard to your script, I am not sure what you are trying to do, or why it is a problem?
Back to top
View user's profile Send private message
Leef_me



Joined: 08 Apr 2009
Posts: 5336
Location: San Diego, California

PostPosted: Fri Mar 12, 2010 6:38 pm    Post subject: Re: (bump) reading non-existant file & line # under Win_ Reply with quote

OceanMachine wrote:
Have you seen this? Might be easier.


thanks, I didn'y know about that.

Quote:
With regard to your script, I am not sure what you are trying to do, or why it is a problem?

I want to read a specific line # from a file, and if that specific line is non-existent, be informed via errorlevel as specified in FileReadLine.

This notification seems to work in Vista-32 but not in my case Win-xp.

I am looking for confirmation of same results or conflicting results.
Or phaps I have an error in my script that I can not see.
Back to top
View user's profile Send private message
hd0202



Joined: 13 Aug 2006
Posts: 265
Location: Germany

PostPosted: Fri Mar 12, 2010 8:20 pm    Post subject: Re: (bump) reading non-existant file & line # under Win_ Reply with quote

Hi, I work with windows XP and it works as expected

Hubert
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group