cancel
Showing results for 
Search instead for 
Did you mean: 

A simple counter for mapping

0 Kudos

Hello Everybody,

You may want to put a counter in your mapping results. I hope this make a clue for your need.

Create a Simple Function as a User-Defined function. Give a name, a description and one input parameter. Your function should like as follows:

public String Counter(String a, Container container) {

String count;

Object counter;

counter = container.getParameter("count");

if (counter == null) {

count = "1";

else {

count = counter.toString();

int i = Integer.valueOf(count).intValue();

i++;

count = Integer.toString(i);

}

container.setParameter("count", count);

return count;

}

You have to set an item in an array as an input parameter. Then you will have an incremental output for each occurence.

Enjoy XI!

Ibrahim

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ibrahim,

Your program really looks great.But I was wondering how to use it and where in XI to use.

Thanks'

Hosahalli