The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
duplicate array objects
#1
Hello,

I currently have a function that gathers all objects (including invisible objects)
Code:
Copy      Help
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
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?


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)