MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - help
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

help

 Post Reply Post Reply
Author
Message
avf View Drop Down
Member
Member


Joined: 30.Jul.2016
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote avf Quote  Post ReplyReply Direct Link To This Post Topic: help
    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
)

Edited by stevek - 30.Jul.2016 at 10:20
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 643
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post 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
}
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.063 seconds.