File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes For loop question (looking at this tooooo long) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "For loop question (looking at this tooooo long)" Watch "For loop question (looking at this tooooo long)" New topic
Author

For loop question (looking at this tooooo long)

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

In the following for loop I am overwriting the String[] paramValues variable each time I am going throw this for loop. Can someone please point out or give me some direction on what I'm doing wrong? I've been looking at this too long and would appreciate another set of eyes.

Regards. Here is my code:

Grant Gainey
Ranch Hand

Joined: Oct 16, 2005
Posts: 65

So what index of paramValues are setting on each loop iteration?

Grant
(edited to remove bogus end-tag)

[ December 06, 2005: Message edited by: Grant Gainey ]
[ December 06, 2005: Message edited by: Grant Gainey ]

In Theory, there is no difference between theory and practice.<br />In Practice, there is no relationship between theory and practice.
Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

Grant,

Thanks for the reply. If I understand your question correctly, the index of paramValues is being set to the ParamNames.length, I think. Since String[] ParamValues = new String[ParmNames.length] is set before the loop.

Is that my problem?
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2861
    
  11

Is there one String value per parameter name? If so, then what you want is this:

Melinda Savoy
Ranch Hand

Joined: Jun 21, 2005
Posts: 387

Greg,

Thanks so much for your reply. I did try that. My problem is that the WebLink link = response.getLinkWithID("ViewLink");

The line of code

paramValues[i] = link.getParameterValues(paramNames[i]);

gives me a MIXMATCH error:
Type mismatch: cannot convert from String[] to String

The getParameterValues method is from the JWebUnit product that I am using to grab the values of both the parameters.

There in lies my problem. I just think I resolved my problem. Thank you both for all the help.

Thanks.
[ December 06, 2005: Message edited by: Melinda Savoy ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: For loop question (looking at this tooooo long)