AutoHotkey Community

It is currently May 27th, 2012, 5:29 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: March 9th, 2010, 6:38 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
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 March 11th, 2010, 9:02 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 11th, 2010, 9:02 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
Bump


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 11th, 2010, 9:43 pm 
Offline

Joined: October 15th, 2007, 3:10 pm
Posts: 790
Location: England
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?


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 12th, 2010, 7:38 pm 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
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.


Report this post
Top
 Profile  
Reply with quote  
PostPosted: March 12th, 2010, 9:20 pm 
Offline

Joined: August 13th, 2006, 6:45 am
Posts: 355
Location: Germany
Hi, I work with windows XP and it works as expected

Hubert


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: dra, rbrtryn, Yahoo [Bot] and 74 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group