Macro Toolworks Products Discussion Forums :: Suggestions & Bug Reports
Welcome Guest   
 Subject :find error .. is not sure... 25-04-2011 03:36:58 
hugblue@hotmail.com
Joined: 13-10-2010 01:09:07
Posts: 100
Location: sweden
i have this text.. could be anything. then i let prg see how many lines there are.
then i search the lines backwards to find a start text. then i search the same line
for an extra word.

and every time it jumps over the first found word. is driving me insane. because i
cannot see if its me or the program.


copy this text to a text file and then open it on your window.
435654 343565 543454
7654456 3234 7865 998 564
2323 abc 9988 776
88 def 453 989 55664 34245
99876 55643 7766 7762 ghi
89765 556 667 67532 jkl

then replace the first move move to the upper left of text.
then replace the second move mouse to the lower right of the text.

then start macro.


<varset>("env=","example name :")<mm>(803,69)<mlbd><wx>(1000,1)<mm>(987,134)<mlbu><ctrl>c<ctrl><var_oper>(enemytext,"",GET_TEXT_FROM_CLIPBOARD,"2","", "0")<var_oper>(enemytextlines,"%enemytext%",TEXT_GET_NUMOFLINES,"2","", "0")<label>("ee1")<varset>("enemyresult=0","")<var_oper>(grabby,"%enemytext%",TEXT_GET_LINE,"enemytextlines","", "0")<var_oper>(enemyresult,"%grabby%",STR_FIND_NOCASE,"env","enemytextlines", "0")<msg>(-100,-100,"%enemytext%

%enemytextlines%
%grabby%

%enemyresult%","-1",1,0,2,1)<if>("enemyresult>=0")<varset>("enemyresult=0","")<msg>(-100,-100,"%enemytext%

%enemytextlines%
%grabby%

%enemyresult%","-1 NAVN FUNDET",1,0,2,1)<var_oper>(enemyresult,"%grabby%",STR_FIND_NOCASE,"abc","enemytextlines", "0")<if>("enemyresult>=0")<msg>(-100,-100,"%enemytext%

lines : %enemytextlines%
%enemyresult%","abc",1,0,2,1)<goto>("ee3")<endif><var_oper>(enemyresult,"%grabby%",STR_FIND_NOCASE,"def","enemytextlines", "0")<if>("enemyresult>0")<msg>(-100,-100,"%enemytext%

lines : %enemytextlines%
%enemyresult%","def",1,0,2,1)<goto>("ee3")<endif><var_oper>(enemyresult,"%grabby%",STR_FIND_NOCASE,"ghi","enemytextlines", "0")<if>("enemyresult>0")<msg>(-100,-100,"%enemytext%

lines : %enemytextlines%
%enemyresult%","ghi",1,0,2,1)<goto>("ee3")<endif><var_oper>(enemyresult,"%grabby%",STR_FIND_NOCASE,"jkl","enemytextlines", "0")<if>("enemyresult>0")<msg>(-100,-100,"%enemytext%

lines : %enemytextlines%
%enemyresult%","jkl",1,0,2,1)<goto>("ee3")<endif><endif><var_oper>(enemytextlines,"%enemytextlines%-1",CALC_EXPRESSION,"0","", "0")<goto>("ee1")<label>("ee3")<msg>(-100,-100,"%enemytext%

lines : %enemytextlines%
%enemyresult%","raise",1,1,2,1)


then try this ..

when macro start. insert 2323. but the program cannot find this. if 2323 came again
later. it would find it.

but it never find the text the first time. never.
and i need it to find the text the first time and then the second text on same line.


hope petr ..
that u can help me..

thz

if u have any questions just ask. smiling.

Attachments
 abc.4tw [382 KB] :: 4tw file
IP Logged
Last Edited On: 25-04-2011 03:48:02 By hugblue@hotmail.com for the Reason code didnt work
 Subject :Re:find error .. is not sure... 25-04-2011 14:08:26 
hugblue@hotmail.com
Joined: 13-10-2010 01:09:07
Posts: 100
Location: sweden
sorry petr..

i found out what i did wrong. i have been sitting here a long time.
and damn it can be hard at times or that we can suddently be blind.

the correction is :

i scanned for lines.
searched backwards.
then when i searched the captured line. i by accident used the total line number,
in the index. that way it would never search from position 0.

my bad..
IP Logged
Page # 


Powered by ccBoard


Login and share your experience - send messages to forums and add comments to samples, commands and other resources.



Account is free of charge, easy to setup.