Re: How to pass array from java to perl using inline java



On Jan 31, 11:50 am, "songta...@xxxxxxxxx" <songta...@xxxxxxxxx>
wrote:
Hi,

Sorry for the multipost. I apologize.

Here is the script that I try to run:

*****************************************************
use Inline Java => <<'EOJ';
public class TestJavaClass
{

public float[ ] [ ] returnArrayData(){
.
.
.
return ArrayData[m][n];
}

}

EOJ

my @mylist = TestJavaClass. returnArrayData();

print "$mylist[0]";

*****************************************************

I got the following output:

Inline::Java::Array=ARRAY(0xa52e234)

When you respond on this list you're asked to quote the attribution
and some appropriate context. Also this script does not look
"complete".

Anyway, you've said your problem is accessing a 2D array, so why are
you only printing the first dimension? In fact, when you do, Perl is
telling you that that first dimension is itself made up of an array.
This is as it should be.

If you're passing a 2D array, you need to access it in two dimensions.

print $mylist[0][0];

for instance should work, but I'm unable to verify it.

-jp

PS: read perldoc -q vars

.



Relevant Pages

  • Re: Logon script - function array and select case not working
    ... this all works well, except, the function i am using for the rules in the control script causes alot of querrys to AD. as there are alot of groups. ... objTSout.writeline retrv ... So if you think that this will assign an array value to the variable, how do you think the case select statement is going go compare this array value with the literal string values such as "group name here"? ... However, by not assigning ANY value to checkgrp in the function, you are guaranteeing that, should the function ever exit, it will return no information. ...
    (microsoft.public.scripting.vbscript)
  • Re: string retrieval issue
    ... Chicago Bears|NFC North ... not writing the third element back to the array). ... You didn't include it in your script. ... Fear is the mind-killer. ...
    (comp.lang.perl.misc)
  • Re: even rows for checkbox forms with no splitting of boxes from values
    ... 'mod' on the array length with a denominator equal to the width of the row, ... State saving really depends on what the script is already doing. ... So I usually roll my own checkboxes. ... #this is to create an array with 25-50 strings 2-10 in length ...
    (comp.infosystems.www.authoring.cgi)
  • Re: settimeout needs alert() ???
    ... function slider { ... and use script to replace the src and title attributes. ... are downloaded completely. ... The usual strategy is to load all of the images in to an array of image ...
    (comp.lang.javascript)
  • Re: BinaryStream.Write ByteArray erroring with Code 800A0BB9, Source ADODB.Stream
    ... script is reaching out to a SQLServer database and grabbing some data ... BinaryStream.Write method expects a byte array, ...     Else ... I made the changes to the script using your code, ...
    (microsoft.public.scripting.vbscript)