Print Page | Close Window

Role info question

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=774
Printed Date: 27.Mar.2026 at 00:26
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Role info question
Posted By: ReeceRobinson
Subject: Role info question
Date Posted: 09.Apr.2014 at 23:36
Hi,

I hope this isn't a dumb question Embarrassed

In my language I have a relationship between two objects. I.e. an association between two classes. I am writing a generator that iterates all the associations and outputs the role info at each end. My problem is that I also need to output the connected class ObjectId when I format the role information. I only have the association and the roles i.e. >Association~Role. How do I get the ObjectId for the class the role is attached to?

Cheers,
Reece



Replies:
Posted By: stevek
Date Posted: 10.Apr.2014 at 01:06
If I understand correctly, you want something like this:
 
foreach >Association
{  'Association ' id newline
   do ~Role
   {  'Role: ' id
      ' for object: ' do .Class { id } newline
   }
   newline
}
 
That will give you the name (human-readable identifier) of the Class (adjust the green type names if they don't match what you have, or use () to match any type name). You mentioned objectID, which is actually a separate MERL command, and answers just the object number part of the internal id of this element, unique in this project; if you want that number instead of the Class name, replace id with objectID in the innermost loop.


Posted By: ReeceRobinson
Date Posted: 10.Apr.2014 at 11:09
Thanks for your help. That is exactly what I wanted to know.

Cheers,
Reece



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