|
|
|
|
Re: Better way to print arrays? [message #1691393 is a reply to message #1691383] |
Tue, 07 April 2015 01:37 |
|
On 04/06/2015 02:40 PM, Norman Noobie wrote:
> I've already got a routine to print the arrays (although
> Arrays.toString() looks interesting. What I want is to dump the
> formatted array from Eclipse itself.
Eclipse is an integrated development environment to help you write
programs in many languages including and especially Java. What do you
mean by "dump ... from Eclipse itself"? Do you mean dump the array to a
file (since obviously you're already dumping it to the console where you
can see it)?
These are "pure Java" questions and nothing to do with Eclipse at all.
You should ask such questions in other forums like javaranch.com or
stackoverflow.com.
|
|
|
Re: Better way to print arrays? [message #1691670 is a reply to message #1691393] |
Wed, 08 April 2015 21:37 |
Norman Noobie Messages: 7 Registered: April 2015 |
Junior Member |
|
|
This is a pure Eclipse question, has nothing to do with Java except that I happen to be writing Java.
It would be very helpful to see my data values change as I step through my code, as opposed to stepping over the entire routine and dumping the result to the console.
Right now when I show a boolean array it has the form:
0:
0:true
1:false
2: false
etc for row 0, then
1:
0: false
1: true
etc.
As it's a 30x30 array that's 900 lines to display the array, a royal pain to navigate as I step through the code manipulating that array. Especially as I'm looking for things that change
The other format I've seen is (assuming a 3x3 array) is:
foo [false, false, true][true, false, false][false, false, false]).
The format may be different, I'm not running Eclipse right now, but you get the gist. It's better, but still difficult to navigate.
This question has nothing to do with Java. The program could be C, C++, perl, Python, or whatever. The question is "how do I better display an array while debugging my program?"
[Updated on: Wed, 08 April 2015 21:54] Report message to a moderator
|
|
|
Re: Better way to print arrays? [message #1691681 is a reply to message #1691670] |
Thu, 09 April 2015 03:09 |
Andrew Mazar Messages: 6 Registered: April 2015 |
Junior Member |
|
|
Norman Noobie wrote on Wed, 08 April 2015 21:37This is a pure Eclipse question, has nothing to do with Java except that I happen to be writing Java.
It would be very helpful to see my data values change as I step through my code, as opposed to stepping over the entire routine and dumping the result to the console.
Right now when I show a boolean array it has the form:
0:
0:true
1:false
2: false
etc for row 0, then
1:
0: false
1: true
etc.
As it's a 30x30 array that's 900 lines to display the array, a royal pain to navigate as I step through the code manipulating that array. Especially as I'm looking for things that change
The other format I've seen is (assuming a 3x3 array) is:
foo [false, false, true][true, false, false][false, false, false]).
The format may be different, I'm not running Eclipse right now, but you get the gist. It's better, but still difficult to navigate.
This question has nothing to do with Java. The program could be C, C++, perl, Python, or whatever. The question is "how do I better display an array while debugging my program?"
One option is to use the debugger.
Add break points and use the debugger tool.
The only other real option is to build a GUI that displays your values in real time.
[Updated on: Thu, 09 April 2015 03:10] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05996 seconds