I am trying to convert VBA code to Java and here is where I am stuck :
How, in Java, do I have to decalre my array of Double "data" in the method "produce" ?
How declare "data" in the method "read_file" to find it transformed then to pass it to the method "create" ?
How to change the type/do the "Redim" in the method "read_file" ?
Thanks for your help as I am returning to Java after more than 10 year stop...
Well, you're asking actually just a technical questions how it is done in Java. But keep in mind, that Java is quite different form VBA, and it won't let you do some crazy things as you could do with VBA.
jacques dusieur wrote:How, in Java, do I have to decalre my array of Double "data"
jacques dusieur wrote:How declare "data" in the method "read_file"
Honestly I don't feel it will help you much. Maybe it would help you better if you'd start reminding yourself about Java from here (<- link to click on).
As alternative, I think we could help you better if you'd describe what the method needs to do in details without using technical terminology, so we could adapt it to Java.
Thank you. Unfortunately it is impossible to describe exactly what it does as it is a lot of statistics information treatment, but I have advanced a little in the skeleton comprehension. I know for sure that I will end up with a 2-dimensions array. I have now the following Java code :
I need to know how to define it correctly and how to pass it by reference (I would like to avoid returning my array, but instead have like an in/out parameter, which is called "pass a parameter by reference" I think) correctly because I still have these 2 issues :
At line PROBLEM 1, my array data seems to have only the first dimension initialised. Indeed, if toto is 100000 and titi 59,if I look up data in debug mode, it says "<error(s)_during_the_evaluation>".
At line PROBLEM 2, my array data is null and has then lost the initialisation and the fill in done in readFile, I must be able to pass data by reference in order to retrieve it as it as been modified.
Thanks again in advance.
jacques dusieur wrote:. . . how to pass it by reference . . .
There is no such thing as pass by reference in Java®. Don't initialise the array to null. Get the create method to return an array
double myArray = readFile(myFile); Why are you passing the array as an output parameter to two methods?
this llama doesn't want your drama, he just wants this tiny ad for his mama