I want to use Java arrays in ivyScript. But if I use myArray[myIndex] then I get an error unexpected token.

So, for example how can I do something like:

File dir = new File("myPath");
File[] fileList = dir.listFiles();

asked 03.09.2009 at 02:42

Benedict%20Groppe's gravatar image

Benedict Groppe
(suspended)
accept rate: 50%


Arrays are not first order objects in ivyScript. But you can work with lists everywhere you would work with arrays in Java. Note, that conversion between arrays and lists happens automatically. So, e.g. this is completely valid and good ivyScript:

File dir = new File("myPath");
List<File> fileList = dir.listFiles();
link

answered 03.09.2009 at 03:09

SupportIvyTeam's gravatar image

SupportIvyTeam ♦♦
1.4k102118122
accept rate: 77%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×52
×33

Asked: 03.09.2009 at 02:42

Seen: 3,464 times

Last updated: 03.09.2009 at 02:42