dnvsrikanth Posted August 25, 2008 Share Posted August 25, 2008 Hi Friends,I want to use a condition in the expression of a variable. To use a condition we can use only ternary operator which has two options. But I want a condition which has only one option.For example:$F{Is_Moderator}.equals( "Y" ) ? $F{total_score} : new Integer(-1)In this operator we have two options in which when the condition returns true, one value else another value.But I want only one option in which the condition has only one option without else part.Thanks in Advance,DNV Srikanth. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted August 25, 2008 Author Share Posted August 25, 2008 Any idea reagarding this??? Link to comment Share on other sites More sharing options...
dnvsrikanth Posted August 25, 2008 Author Share Posted August 25, 2008 Lucian,Can you please provide me a solution for this???Thanks & Regards,DNV Srikanth. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted August 25, 2008 Author Share Posted August 25, 2008 We have an urgent requirement for this, can anyone provide me a solution for this... Link to comment Share on other sites More sharing options...
svenn Posted August 25, 2008 Share Posted August 25, 2008 Why not$F{Is_Moderator}.equals( "Y" ) ? $F{total_score} : new Integer(0))A lot depends on what you finally want to do with the variable value as in what you want to display and how you are evaluating the variable (sum, average, etc). Link to comment Share on other sites More sharing options...
dnvsrikanth Posted August 26, 2008 Author Share Posted August 26, 2008 Hi,I want to capture the value when thae condition returns true. I dont want the other part. In my application there are two cases in which the condition returns true and false. I want to capture the value only when the condition returns true. Thanks,DNV Srikanth. Link to comment Share on other sites More sharing options...
dnvsrikanth Posted August 27, 2008 Author Share Posted August 27, 2008 Any Idea/any suggestion Link to comment Share on other sites More sharing options...
dnvsrikanth Posted August 28, 2008 Author Share Posted August 28, 2008 Any suggestions regarding this???Thanks in AdvanceDNV Srikanth Link to comment Share on other sites More sharing options...
svenn Posted August 28, 2008 Share Posted August 28, 2008 I would love to help you but I don't understand what you tring to do with this variable. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now