Results 21 to 26 of 26
- 04-03-2012, 04:53 AM #21
Member
- Join Date
- Mar 2012
- Posts
- 13
- Rep Power
- 0
Re: Found a bug, need others to confirm.
Before Trues: 3084
After Trues: 3071
Before/After Difference: 13
Drops Hit: 13
Before Trues: 3084
After Trues: 3059
Before/After Difference: 25
Drops Hit: 25
Before Trues: 3072
After Trues: 3059
Before/After Difference: 13
Drops Hit: 13
Before Trues: 3072
After Trues: 3047
Before/After Difference: 25
Drops Hit: 25
Before Trues: 3060
After Trues: 3047
Before/After Difference: 13
Drops Hit: 13
Before Trues: 3060
After Trues: 3035
Before/After Difference: 25
Drops Hit: 25
Before Trues: 3048
After Trues: 3035
Before/After Difference: 13
Drops Hit: 13
Before Trues: 3048
After Trues: 3023
Before/After Difference: 25
Drops Hit: 25
Before Trues: 3036
After Trues: 3023
Before/After Difference: 13
Drops Hit: 13
Before Trues: 3036
After Trues: 3011
Before/After Difference: 25
Drops Hit: 25
Before Trues: 3024
After Trues: 3011
Before/After Difference: 13
Drops Hit: 13
omg, yellowledbet you are my hero! :)))
all i was trying to do is to move all sub arrays down a level in the main array, dropping the last one and keeping the first one untouched.
so, hold on. what exactly was going on with what i had before??
can someone explain?Last edited by SergeLo; 04-03-2012 at 05:00 AM.
- 04-03-2012, 05:09 AM #22
Senior Member
- Join Date
- Feb 2011
- Location
- Georgia, USA
- Posts
- 122
- Rep Power
- 0
Re: Found a bug, need others to confirm.
glad it worked. I am sure someone can explain this better, but I will give it a shot. Arrays are passed by reference (EDIT: The preceding statement is false, see DarrylBurke's link for clarification). So instead of changing the values in each array within your array you were changing the reference to the array. If you think about the cumulative effect of this, you are making a bunch of array variables point to the same array.
Last edited by yellowledbet; 04-03-2012 at 01:16 PM.
- 04-03-2012, 06:16 AM #23
Member
- Join Date
- Mar 2012
- Posts
- 13
- Rep Power
- 0
Re: Found a bug, need others to confirm.
ahhhh! gotcha!
so as i was moving them down over an over, eventually the whole array held references to the first element in the array. so when one thing changed so did the ones above... Which is what led me to think that one assignment changed more than one location when each one was really the same location.
Thank You :)Last edited by SergeLo; 04-03-2012 at 06:27 AM.
- 04-03-2012, 06:52 AM #24
Re: Found a bug, need others to confirm.
No they are not. Array and other object references are passed by value, which isn't the same thing.
Recommended reading, in the order listed:
JavaRanch Campfire - Cup Size: a Story About Variables
JavaRanch Campfire - Pass By Value, Please
dbIf you're forever cleaning cobwebs, it's time to get rid of the spiders.
- 04-03-2012, 08:26 AM #25
Member
- Join Date
- Mar 2012
- Posts
- 13
- Rep Power
- 0
Re: Found a bug, need others to confirm.
haha, i enjoyed that.
Daryl, what yellowledbet said by definition is wrong, but I'm sure what he meant by passing by reference is passing the value of the reference.
now... my rain array then means that its a remote in control of many other remotes... O.o
Anyways, thanks for ur help aswell DarylLast edited by SergeLo; 04-03-2012 at 09:27 AM.
- 04-03-2012, 01:10 PM #26
Senior Member
- Join Date
- Feb 2011
- Location
- Georgia, USA
- Posts
- 122
- Rep Power
- 0
Similar Threads
-
Confirm Dialog box ?
By ady_bavarezu89 in forum AWT / SwingReplies: 13Last Post: 06-11-2011, 01:56 PM -
Confirm dialog+pass parameters
By barcelonax in forum JavaServer Faces (JSF)Replies: 0Last Post: 12-21-2010, 08:20 AM -
show Confirm Perspective Switch dialog box
By mostafa in forum EclipseReplies: 0Last Post: 11-22-2008, 11:47 AM -
Yes/No confirm dialog box
By mandrake446 in forum Advanced JavaReplies: 2Last Post: 12-09-2007, 05:31 AM
Bookmarks