Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How 2 read information on a file
#1
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.
#2
str s2.getfile("c:\test.txt")

http://www.quickmacros.com/help/index.p ... RINGS.html
pi
#3
ok sorry had the code rihgt just had a space on the file that was messing it up
#4
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
#5
setfile adds new line if used with flag 1. Read setfile documentation in QM help.
#6
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
#7
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.
An old blog on QM coding and automation.

The Macro Hook
#8
never did that can u give an example.
#9
you can start here.
http://www.quickmacros.com/help/Functions/IDP_FIND.html

it's the 'i' that you would check the value of.
An old blog on QM coding and automation.

The Macro Hook
#10
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
#11
Using find is OK. Another way - enumerate lines in the file.

str s
foreach s a
,if b=s
,,clo TriggerWindow
#12
ok thank u very much that did it


Forum Jump:


Users browsing this thread: 1 Guest(s)