on 08-07-2007 11:11 PM
Hi
I wrote UDF to check the Amount value..But i am getting error Return statement } missing
My code is like
public String AmountValue(String a,Container container){
//write your code here
int i = Integer.parseInt(a);
if(i > 0)
i = 100;
else
throw new RuntimeException("Value should be Greater than zero");
}
venkat
Use this code - it will work
int i = Integer.parseInt(a);
if(i > 0)
i = 100;
else
throw new RuntimeException("Value should be Greater than zero");
return Integer.toString(i); // or return ""+i; or return "";
Regards,
Balaji.M
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Venkatesh,
The above function will always throw an excepption. Use try catch block.
Best regards,
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
venkatesh,
you have to have a <b>return</b> statement in the UDF, when it is not of context or queue type.
Add this line to the end of your UDF:
return i;
Regards,
Henrique.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.