Skip to Content

A simple counter for mapping

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();


    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!


Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Dec 18, 2003 at 04:17 PM

    Hi Ibrahim,

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



    Add comment
    10|10000 characters needed characters exceeded