Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

@configurable how to load an Array or a list ?
 Post subject: @configurable how to load an Array or a list ? Post rating: 0   New post Posted: Mon 29 Nov, 2010, 18:56 
User avatar

User rating: 5
Joined: Fri 02 Sep, 2011, 10:08
Posts: 157
Location: FranceFrance
Hi,

With the use of the optimiser, I have to try different strings as parameter so I'm using @Configurable like this :

 @Configurable("test : ")
    public String MyTest = "Test1";


The problem is, I have to add manually in the box other values for MyTest (for ex. "Test2", "test3"...)

How can I preload all values without having to write them each time ?
I tried to make an Array or a list, but it doesn't seem to work.

 @Configurable("testArray : ")
    public String [] MyTest = {"Test1", "Test2", "Test3"};


or

@Configurable("testList : ")
    List<String> MyTest = new ArrayList<String>();
    MyTest .add("Test1");
    MyTest .add("Test2");
    MyTest .add("Test3");


Tanks


 
 Post subject: Re: @configurable how to load an Array or a list ? Post rating: 0   New post Posted: Wed 01 Dec, 2010, 11:08 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi,
It is not possible.


 
 Post subject: Re: @configurable how to load an Array or a list ? Post rating: 0   New post Posted: Wed 01 Dec, 2010, 21:06 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
Hi,

you could pass a token as @Configurable and then in onStart load that token into an array:

@Configurable("testToken : ")
    public String myTestToken = "Test1;Test2;Test3";

public String[] myTestArray;

...
   public void onStart(IContext _context) throws JFException
   {
          myTestArray = myTestToken.split(";");
   }


Best,
RR.


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com