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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.