Print Page | Close Window

Collection of graph

Printed From: MetaCase
Category:
Forum Name: MetaEdit+
Forum Description: All topics relating to MetaEdit+ or DSM
URL: http://www.metacase.com/forums/forum_posts.asp?TID=889
Printed Date: 18.Apr.2024 at 22:46
Software Version: Web Wiz Forums 12.05 - http://www.webwizforums.com


Topic: Collection of graph
Posted By: Gali
Subject: Collection of graph
Date Posted: 02.Jul.2018 at 03:51
Hello,

I define an object (Event) in which one attribute (scenes) is a collection of another graph(SceneDesign).
Now I want to output everything in all the scenes in the event. what should I do.


Gali



Replies:
Posted By: stevek
Date Posted: 02.Jul.2018 at 08:30
You can use http://www.metacase.com/support/55/manuals/mwb/Mw-6_3_3.html" rel="nofollow - do to iterate over the collection property, and inside each Scene Design graph there you can use http://www.metacase.com/support/55/manuals/mwb/Mw-6_3_2.html" rel="nofollow - foreach to iterate over the objects there:
foreach .Event
'Event: ' id newline
   do :scenes
   {  '   Scene graph: ' id newline
      foreach .()
      {  '      ' id ': ' type newline
      }    
   }
}
Better style is to refactor the parts inside Scene Design into a new generator, which you write in the Scene Design graph type. The top-level generator thus has:
foreach .Event
'Event: ' id newline
   do :scenes
   {  _Contents()
   }
}
and in a http://www.metacase.com/support/55/manuals/mwb/Mw-5_3_1.html#Heading1436" rel="nofollow - new Generator Editor in Scene Design:
_Contents()
'Scene graph: ' id newline
foreach .()
'      ' id ': ' type newline
}
It's important to save generators in the right graph type. When http://www.metacase.com/support/55/manuals/mwb/Mw-6_3_12.html" rel="nofollow - calling a sub-generator , it is looked up in the generators of the current graph's type. The current graph changes when you navigate into a different graph, as you do here inside do :scenes {_Contents()}. The sub-generator _Contents() will thus be looked up in the generators of the Scene Design graph type.


Posted By: Gali
Date Posted: 02.Jul.2018 at 09:15
Thank you~Smile



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