Aug 2, 2002 #1 Guest_imported New member Joined Jan 1, 1970 Messages 0 How can i turn this into crytal syntax? If x { if y { a; } else b } else b
Aug 2, 2002 #2 synapsevampire Programmer Joined Mar 23, 2002 Messages 20,180 Location US That would be: If x and y then (note: use = <somevalue> unless it's a boolean) A else B -k http://www.informeddatadecisions.comkai@informeddatadecisions.com Upvote 0 Downvote
That would be: If x and y then (note: use = <somevalue> unless it's a boolean) A else B -k http://www.informeddatadecisions.comkai@informeddatadecisions.com
Aug 2, 2002 #3 synapsevampire Programmer Joined Mar 23, 2002 Messages 20,180 Location US Perhaps a real example might help, sounds like your new to Crystal syntax: if {MyTable.MyField_1} = 100 and {MyTable.MyField_2} = 300 then "It's 100 and 300" else "It's not 100 and 300" -k http://www.informeddatadecisions.comkai@informeddatadecisions.com Upvote 0 Downvote
Perhaps a real example might help, sounds like your new to Crystal syntax: if {MyTable.MyField_1} = 100 and {MyTable.MyField_2} = 300 then "It's 100 and 300" else "It's not 100 and 300" -k http://www.informeddatadecisions.comkai@informeddatadecisions.com
Aug 2, 2002 #4 chelseatech Instructor Joined Aug 25, 2001 Messages 1,812 Location NZ in some situations, that wont work. For examples NULL's will not give you A or B, the AND will result in a result of NULL. You can nest ifs logically as you'd expect. And you can use "(" instead of your "{". But you need a "Then" If x then if y then a else b else b is valid CR sytax. Spaces and indenting are optional but help to see what is going on. If x then if y then a else b else b is the same formula but is a lot harder to follow. Editor and Publisher of Crystal Clear http://www.chelseatech.co.nz/pubs.htm Upvote 0 Downvote
in some situations, that wont work. For examples NULL's will not give you A or B, the AND will result in a result of NULL. You can nest ifs logically as you'd expect. And you can use "(" instead of your "{". But you need a "Then" If x then if y then a else b else b is valid CR sytax. Spaces and indenting are optional but help to see what is going on. If x then if y then a else b else b is the same formula but is a lot harder to follow. Editor and Publisher of Crystal Clear http://www.chelseatech.co.nz/pubs.htm