Print Page | Close Window

Accessing properties of subobjects

Printed From: MetaCase
Category:
Forum Name: MetaEdit+
Forum Description: All topics relating to MetaEdit+ or DSM
URL: https://www.metacase.com/forums/forum_posts.asp?TID=398
Printed Date: 27.Mar.2026 at 00:26
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Accessing properties of subobjects
Posted By: Tahir
Subject: Accessing properties of subobjects
Date Posted: 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



Replies:
Posted By: stevek
Date 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, http://www.metacase.com/support/45/manuals/mwb/Mw-5_3_4.html - 5.3.4 Control and navigation commands , 'Do loop'.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.05 - http://www.webwizforums.com
Copyright ©2001-2022 Web Wiz Ltd. - https://www.webwiz.net