on 08-30-2007 10:11 AM
Hi All,
I write a UDF to change context but it is not working properly
can any please guide me. code is ,
for (int i = 0 ; i<Plant.length ; i ++)
{
int b = 0;
for (int j = 0 ; j<Plant.length ; j++)
{
if (i!=j)
{
if (Plant<i>.equals(Plant[j]) )
{
b++;
}
}
}
if (b > 0 )
{
result.addValue(ResultList.CC);
}
else
{
result.addValue ("true") ;
}
}
In this code it is working for 'result.addValue ("true")' but not for 'result.addValue(ResultList.CC)'
Can any one tell me where is a problem?
---Rohit
try this
result.addContextChange(); instead of result.addValue(ResultList.CC);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rohit,
I've doubt that the condition for true is not satisfied and it always goes to else block.
Add MappingTrace to your code and check if its going to the If block or always it goes to esle block.
One more thing what is this operator for (int j = 0 ;<b> j><Plant.length</b> ; j++) ? What r u trying to achieve...
-raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The if / else statement is out of your for loop. Is it correct? I don't understand what your UDF should do, maybe you can give an example of your Plant[] string list and what you'd expect.
if (b > 0 )
{
result.addValue(ResultList.CC);
}
else
{
result.addValue ("true") ;
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rohit,
As earlier mentioned to add context change you need to :
result.addContextChange();
Regards,
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you decribe what you expect with an XML example?
And what do mean with "not working"?
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.