cancel
Showing results for 
Search instead for 
Did you mean: 

udf java code

Former Member
0 Kudos

Hi

I have wrote below UDF using "context" and want to pass the temp<i> to the result.

If I wrote code like this I am getting the error telling the expression result = (temp [ ]); is incorrect.

Any java guys......could you plz help me for the correct expression ??

public void test(String[] a, String[] b, ResultList result, Container container)

{

String[ ] temp = new String[100];

for (int i = 0; i < a.length; i++) {

if ((a<i>) == "001")

temp<i>= b<i>;

}

result = (temp [ ]);

}

thanks

kumar

Accepted Solutions (1)

Accepted Solutions (1)

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

HI,

public void test(String] a, String[ b, ResultList result, Container container)

{

String[ ] temp = new String100;

for (int i = 0; i < a.length; i++) {

if ((a) == "001")

temp= b;

}

result = (temp [ ]);

}

You must return a ResultList object

If you want to return all values of temp do this

for (int i = 0; i < temp.size(); i++) {

result.addValue(temp<i>);

}

Thnaks

Rodrigo

Answers (1)

Answers (1)

Former Member
0 Kudos

solved myself