![]() |
Accessing properties of subobjects |
Post Reply
|
| Author | |
Tahir
Major Contributor
Joined: 01.Mar.2012 Points: 27 |
Post Options
Thanks(0)
Quote Reply
Topic: Accessing properties of subobjectsPosted: 02.Mar.2012 at 18:34 |
|
Hello again!
How do we access properties of sub- and subsub ojects using MERL? The following is my scenario. I have a graph with an object named Obj1. Obj1 has a property named Prop1. The datatype for Prop1 is another object named Obj2. The Obj2 in turn have a property named Prop2. Prop2 has a data type of a Number. I want to check the value of Prop2 when writing a generator for the graph with Obj1. Best Regards /Tahir |
|
![]() |
|
stevek
MetaCase
Joined: 11.Mar.2008 Points: 643 |
Post Options
Thanks(0)
Quote Reply
Posted: 02.Mar.2012 at 19:06 |
|
You can iterate over the object or objects in a property with do or dowhile. E.g. to go through all Obj1s and list the value of their Prop1 object's Prop2:foreach .Obj1
{ do :Prop1 { :Prop2 } newline } If Prop1 doesn't contain any object, then "do :Prop1 {}" will do nothing. For more details, please see the Workbench manual's chapter on MERL, 5.3.4 Control and navigation commands, 'Do loop'.
|
|
![]() |
|
Post Reply
|
|
| Tweet |
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |