08-02-2012, 01:54 PM
Hello,
I currently have a function that gathers all objects (including invisible objects)
my problem is there are duplicate objects. I want to edit this function so that if there is an object with the same name, role, and location it will not be added to the array.
I was talking with someone and he was saying i could try making a boolean that is declared as false, and if there is a duplicate it will change the boolean to true. If the boolean is true then it will not write to the array.
Any thoughts on how i can edit the current code to work how i want it to?
I currently have a function that gathers all objects (including invisible objects)
int w=win("Calculator" "SciCalc")
Acc a.Find(w "WINDOW" "Calculator" "class=SciCalc" 0x1005)
ARRAY(Acc) b
int i
str data
str ress="Resolution :"
str orie="Orientation :"
str saveTo="$desktop$\Macro.txt"
str name role; int x y cx cy
int w1=win("Calculator" "SciCalc")
Acc a1.Find(w1 "WINDOW" "Calculator" "class=SciCalc" 0x1005)
a.GetChildObjects(b -1 "" "" "" 16)
for i 0 b.len
,b[i].Role(role)
,name=b[i].Name
,b[i].Location(x y cx cy)
,data.formata(" %i : %s : %s : %i %i %i %i[]" i role name x y cx cy)
out data
I was talking with someone and he was saying i could try making a boolean that is declared as false, and if there is a duplicate it will change the boolean to true. If the boolean is true then it will not write to the array.
Any thoughts on how i can edit the current code to work how i want it to?