You could use getRelationship() as I sent earlier, but it would be a bit clumsy. Easier to test for validity directly, something like (off the top of my head ...)

function canItBeValid p1, p2, pRelationship
  put sample(p1) into p1
  put sample(p2) into p2
  switch pRelationship
  case "="
     if p1 is among the lines of gOlder[p2] then return false
     if p2 is among the lines of gOlder[p1] then return false
     return true
  case "<"
     if p1 = p2 then return false
     if p1 is among the lines of gOlder[p2] then return false
     return true
  case ">
     if p1 = p2 then return false
     if p2 is among the lines of gOlder[p1] then return false
     return true
   default
      ask "bad relationship" && pRelationship
      return false
  end switch
end canItBeValid


but I see from a later email you have something already working, so go with that :-)

-- Alex.


On 11/03/2011 11:48, Malte Brill wrote:
Hi Alex,

well what I need to do is to check if the relationship I am wanting to set is 
valid or not, before I write it to the database. I might not be clear enough. 
But my goal is not really to check for existing relations, but the validity of 
the data I am about to enter into the Database. So if there is no relation at 
all, any relation is valid. Direct relations are clear and indirect relations 
need to be checked for.

Maybe I just dot understand how I would use your script in that case.

Sorry for the confusion.

Malte


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to