08-01-2007, 04:10 AM
i am trying 2 read info from a file and compare the info on that file with some text i am getting just not sure how 2 get the text information from a file without opening it.
How 2 read information on a file
|
08-01-2007, 04:10 AM
i am trying 2 read info from a file and compare the info on that file with some text i am getting just not sure how 2 get the text information from a file without opening it.
08-01-2007, 07:06 AM
08-01-2007, 05:13 PM
ok sorry had the code rihgt just had a space on the file that was messing it up
08-01-2007, 07:35 PM
ok have another question
can't seem 2 solve this 1 i am using this code str a b b.getwintext(win("window name" "window class")); err b.setfile("$Desktop$\test\test.txt" -1 -1 1) it works but it seems 2 be adding hidden characters so when i try using this code 2 read it if there is more than 1 line nothing happens int hwnd=val(_command) str a b b.getwintext(hwnd); err a.getfile("$Desktop$\test\test.txt") out a out b if b=a clo TriggerWindow; err it shows what is in the file but it seems there is hidden characters because there is a space
08-01-2007, 07:46 PM
setfile adds new line if used with flag 1. Read setfile documentation in QM help.
08-01-2007, 08:29 PM
ok this is what i am trying 2 do.
the file will have mutliple entries on it i want the macro 2 check the file and see if an entry matches the current window.but when it has more than 1 entry it doesn't respond
08-01-2007, 08:36 PM
sounds like you need to do a 'find' for b in a. if that value (an integer) in greater than -1 then it is in a.
08-01-2007, 08:38 PM
never did that can u give an example.
08-01-2007, 08:42 PM
you can start here.
http://www.quickmacros.com/help/Functions/IDP_FIND.html it's the 'i' that you would check the value of.
08-01-2007, 08:51 PM
not sure how 2 implement that it show how 2 convert it 2 a number
ok maybe i didn't explain it all the way i ahve a macro that is trigger by a window text,what i want it 2 do is check a file and see if the text matches and if it does do an action. i can make the file add text 2 the file but can't seem 2 get it 2 match when there is more than 1 entry in the file
08-01-2007, 08:56 PM
Using find is OK. Another way - enumerate lines in the file.
str s foreach s a ,if b=s ,,clo TriggerWindow
08-01-2007, 09:01 PM
ok thank u very much that did it
|
« Next Oldest | Next Newest »
|