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
ARRAY of custom type as parameter
#1
Hi Gintaras, hi all

i tried to "improve" the now well known Firefox4GetTabs function.

To fit my needs, i'd like to sum some tabs properties directly in a variable, and use what i need in time.

But i fail to find the right syntax. Little push needed here.

What i did, but do not work.....

in calling macro

type TABPROP str'name str'url int'index (and some more)
ARRAY(TABPROP) tabs
int selectedTab=Firefox4GetTabs(0 tabs)

--------------------------------------------------
modified Firefox4GetTabs function

function# hwndFF ARRAY(TABPROP)&tabs

** need tabs initialization here
if(!hwndFF) hwndFF=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804); if(!hwndFF) ret -1

enum tabs
Acc a.Find(hwndFF "PAGETAB" "" "class=MozillaWindowClass" 0x1004)
rep
if(a.Role!ROLE_SYSTEM_PAGETAB) goto next ;;[ + ] button
tabs[].name=a.Name

get selected tab
if(r<0 and a.State&STATE_SYSTEM_SELECTED) tabs[].index=i
.......
a.Navigate("n"); err break
i+1




enum panes


a.Find(hwndFF "DOCUMENT" "" "" 0x3011 2 0 "pa3fi")
rep
get id of this pane, and find in ap
fn.FromAcc(a); _s=fn.Attribute("id")
for(i 0 ap.len) if(ap[i]=_s) break
if(i=urls.len) goto next2 ;;should never happen
get url and store in urls[i]

Acc aa; a.Navigate("fi2" aa)
tabs[].url=a.value
.....
a.Navigate("n"); err break

etc etc
I think you get the picture...

Thanks


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)