RE: [jade-develop] Optional arguments for agents


Subject: RE: [jade-develop] Optional arguments for agents
From: Kaizhi Tang (kxt179@psu.edu)
Date: Tue Oct 22 2002 - 21:52:17 MET DST


Did you use setArguments method in your agent?

k.z

-----Original Message-----
From: jade-develop-admin@sharon.cselt.it
[mailto:jade-develop-admin@sharon.cselt.it] On Behalf Of Heiko
Holtschneider
Sent: Tuesday, October 22, 2002 11:17 AM
To: jade-develop@sharon.cselt.it
Subject: [jade-develop] Optional arguments for agents

Dear JADErs,

I experience the following problem when giving agents some optional
arguments on start-up:

When starting an agent over the command line the argument is either null
(no argument passed to the agent) or it is the specified String Object.
In my programm I check for null.

However, when I try to start an agent (without argument) with the RMA,
something else must be passed to the agent. I get a
java.lang.ArrayIndexOutOfBoundsException. I marked the line the
exception occurrs.

What am I doing wrong? And how else could I check whether an argument
is passed to the agent or not?

I attached the code-snipplet I check for the argument with.

Thanks in advance for any help,

Heiko

===================================================================
        Object[] argFN;
        if((argFN = getArguments())==null) {
            System.out.println("NULL NULL");
            configFN=null;
        }
        else {
--->>>> System.out.println("\nconfFN:"+(String)argFN[0]);
            configFN = (String)argFN[0];
        }
===================================================================

-- 
Heiko Holtschneider
mailto:heiko.holtschneider@post.rwth-aachen.de
_______________________________________________
jade-develop mailing list
jade-develop@sharon.cselt.it
http://sharon.cselt.it/mailman/listinfo/jade-develop
UNSUBSCRIBE INSTRUCTIONS AT http://jade.cselt.it/mailing.htm#unsubscribe



This archive was generated by hypermail 2a22 : Tue Oct 22 2002 - 21:53:14 MET DST