passing a double[]

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

passing a double[]

Andreas Zieritz
I'm doing something wrong, but I don't know what. What I want is to pass an
array     to a method.




/* test.nrx */
a = double[2] 0

a[0] = 25
a[1] = 39

b = test1()
b.calldouble(a)




/* test1.nrx */
class test1 public

method test1()

method calldouble(x=double[]) public
        say x[0]
        say x[1]




When compiling to java(OS/2, JDK 1.1.4) I get...

NetRexx portable processor, version 1.125
Copyright (c) IBM Corporation, 1998.  All rights reserved.
Program test.nrx
 9 +++ b.calldouble(a)
   +++   ^^^^^^^^^^
   +++ Error: The method 'calldouble(netrexx.lang.Rexx)' cannot be found in
class 'test1' or a superclass
Compilation of 'test.nrx' failed [one error]


Does anyone know why?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: passing a double[]

J.Pena
Addressed to: Andreas Zieritz <[hidden email]>
              [hidden email]

** Reply to note from Andreas Zieritz <[hidden email]> Mon, 23 Feb 1998 08:13:58 +0100
I tried to reproduce the error also trying other element types such as
'int' and 'Rexx' but everything turned out Ok. I changed your source,
however, in one spot - you had written:

  a = double[2] 0

.. and I wrote:

  a = double[2]

..that is, I just declared the size only.

---------------
cjpena
[hidden email]
---------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: passing a double[]

Mike Cowlishaw-2
In reply to this post by Andreas Zieritz
Your line of code:

  a = double[2] 0

creates a double[] array and then converts it to a string and concatenates 0 to
it (with a blank).  The resulting string is of type Rexx, so that is what 'a'
has as its type.   (The .crossref file should confirm this.)

You should also see this if you compile and run with a 'trace results'
instruction.

Mike Cowlishaw, IBM Fellow, IBM UK Laboratories
mailto:[hidden email]   [http://www2.hursley.ibm.com]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>

Reply | Threaded
Open this post in threaded view
|

Re: passing a double[]

Andreas Zieritz
Thanks for the hints, everything works now.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe from this mailing list ( ibm-netrexx ), please send a note to
[hidden email]
with the following message in the body of the note
unsubscribe ibm-netrexx <e-mail address>