Public Method in ScopeLib hides references to other Panels

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
14 posts • Page 2 of 2
emaddocks
Posts:83
Joined: Tue Sep 04, 2018 12:50 am

Re: Public Method in ScopeLib hides references to other Panels

Post by emaddocks »

Thanks Martin!

Another quick one, do you know if there is a function to get a list of all the panel references on a panel?

Currently I'm using the getShapes function and then pulling out the 'shapes' prefixed with PANEL_REF.


Cheers
Eric

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Public Method in ScopeLib hides references to other Panels

Post by mkoller »

No really elegant way, but what is correct is:
using getShapes() getting all shapes; in a loop ask each shape for the "refName" attribute, which gives the PanelRef name.
Put the result into a dyn_string, at the end, use dynUnique

Code: Select all

main(mapping event)
{
  dyn_string all = getShapes(myModuleName(), myPanelName(), "");
  dyn_string refs;
  for (int i = 1; i

leoknipp
Posts:2928
Joined: Tue Aug 24, 2010 7:28 pm

Re: Public Method in ScopeLib hides references to other Panels

Post by leoknipp »

If have used a similar approach to get the references in a panel.

main(mapping event)
{
dyn_string ds_shapes;
dyn_string ds_refs;
int i;

// get all shapes
ds_shapes = getShapes(myModuleName(),myPanelName(),"",1);
DebugTN("all shapes",ds_shapes);

for(i=1;i 0)
{
string s_name;

s_name = substr(ds_shapes,0,i_pos);

if(!dynContains(ds_refs,s_name))
dynAppend(ds_refs,s_name);
}
}
DebugTN("all references",ds_refs);
}

Best Regards
Leopold Knipp
Senior Support Specialist

emaddocks
Posts:83
Joined: Tue Sep 04, 2018 12:50 am

Re: Public Method in ScopeLib hides references to other Panels

Post by emaddocks »

Thanks Martin and Leopold,

I was trying to use getValue but didn't know what the parameter name to get was (using "refName" and "namePath" works great!).

Cheers
Eric

14 posts • Page 2 of 2