cancel
Showing results for 
Search instead for 
Did you mean: 

Java Sections

Former Member
0 Kudos

Hi,

I try to generate a sequence number as described in this thread:

Unfortunately I allways got the error:

[...] found : int required: java.lang.Integer Integer counter =0;

What do I wrong with this example? Obviously it will not except my counter declaration? May be someone has a working example for a sequence generator.

Regards Oliver

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Oliver,

Why are you trying to declare

Integer count =0;

?

Why not use

int count =0;

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh

I just declared the example of the other thread and of course you are right, I declared the following:

Global Variables:

int counter;

Initialization Section:

counter=10;

and the Id Counter UDF is as simple as following:

String a = Integer.toString(counter);

counter = counter + 1;

return a;

I did not use any get/set methods anymore. Is this the new functionality to access global parameter directly? Is there any risk regarding this?

Regards Oliver

bhavesh_kantilal
Active Contributor
0 Kudos

><i> did not use any get/set methods anymore. Is this the new functionality to access global parameter directly?</i>

You are on the right track. No need of get and set methods .

No risk as well. Simpler than Global Container.

Just add trace statements and check where you are getting this error in runtime.

Regards

Bhavesh

Former Member
0 Kudos

Not that bad! Thanks once again.

Regards Oliver

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

>>>>

If you want generate sequence no on runtime scenario..

try with this

/******UDF*******/

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

result.addValue(i+"");

Create queue mapping...assume "a" is String array.

Cheers!

Samarjit