Cancel
Showing results for 
Search instead for 
Did you mean: 

How to Read an Object ID (no MU)?

Experimenter
Experimenter

Hi together,

Currently I have the challenge to get the child id of frame objects (networks). I already know how to use childno when I already know the id or how to read the id for MUs but how can I read it like this:

 

current.StreamNo := 100 + current.id (or current.childno);

 

In case that there is no way: What is the adress of the table where the instances for a class are managed?

 

Of course it is possible to create a table manually and achieve this functionality but there must be a more elegant way I simply don't get.

 

Thanks in advance.

 

Best regards

Florian

2 REPLIES

Re: How to Read an Object ID (no MU)?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

The class of the frame "knows" everything about their children, so you could use a simple method to get the child-number of an object:

 

(cl:object) :integer
is
 i:integer;
do
 
 for i:=1 to cl.class.numChildren loop
  if cl.class.childNo(i) = cl then
   return i;
  end;
 next; 
end;

if the method name is e.g. getOwnChildno  our call would look like:

 

current.StreamNo := 100 + getOwnChildno(current);

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net

Re: How to Read an Object ID (no MU)?

Experimenter
Experimenter

Ok but it's good to know that there is no direct attribute for this.

 

Thanks for this and best regards

Florian