 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Tue Mar 09, 2010 5:38 am Post subject: (bump) reading non-existant file & line # under Win_XP |
|
|
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 |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Thu Mar 11, 2010 8:02 pm Post subject: |
|
|
| Bump |
|
| Back to top |
|
 |
OceanMachine
Joined: 15 Oct 2007 Posts: 780 Location: England
|
Posted: Thu Mar 11, 2010 8:43 pm Post subject: Re: (bump) reading non-existant file & line # under Win_ |
|
|
| 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 |
|
 |
Leef_me
Joined: 08 Apr 2009 Posts: 5336 Location: San Diego, California
|
Posted: Fri Mar 12, 2010 6:38 pm Post subject: Re: (bump) reading non-existant file & line # under Win_ |
|
|
| 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 |
|
 |
hd0202
Joined: 13 Aug 2006 Posts: 265 Location: Germany
|
Posted: Fri Mar 12, 2010 8:20 pm Post subject: Re: (bump) reading non-existant file & line # under Win_ |
|
|
Hi, I work with windows XP and it works as expected
Hubert |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|