Print Page | Close Window

help

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


Topic: help
Posted By: avf
Subject: help
Date Posted: 30.Jul.2016 at 07:42
hi,
I have a question.
I have two object and each object have two Properties. for example (A object and their properties B and C) and (D object and their properties E and F)

I want Put a constraint. if F property has selection H, in C property just allow one element.
can write this constraint with merl?
can you help me?
best regard
uploads/1066/pictureavf20.png" rel="nofollow"> )



Replies:
Posted By: stevek
Date Posted: 30.Jul.2016 at 10:18
I'd put a text element with a generator in G's symbol:
do .D { @f = :F }
if @f = 'H' then
   do .A do :C { if @++cSize = '2' then 'C too large' endif } }
endif

If you know some extra constraints, e.g. that each relationship G has just one A and one D, and that each entry in C has no spaces (so the string representation of all of C might be 'C1 C2 C3', and hence contain a space only if there is more than one element), you can save some code:
if .D:F = 'H' then
   if .A:C =~ '* *' then 'C too large' endif
endif

Best practice would be have the text element generator simply be a call to a generator defined in the graph type. By convention such generators are called something like __sym_G_cSize(). Defining the generator in the graph type lets you reuse that check in other generators, e.g. 
__LiveCheck()
foreach >G
{  @error=__sym_G_cSize()
   if @error then @error ' in ' do .A {:B} ' and ' id newline endif
}



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