Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing an array in an applet tag

Status
Not open for further replies.

scheenstra

Programmer
Feb 28, 2002
15
US
I'm writing an applet and want to pass an array through an html applet tag. I've done so before with normal variable by doing this.

<APPLET
code = &quot;Lams1.class&quot;
width = &quot;500&quot;
height = &quot;300&quot;
>
<param name = DemandMin value=99>
</APPLET>

and then using a try-catch block like this,

String goget;
goget = getParameter(&quot;DemandMin&quot;);
try {
if (goget != null) // if found
demandmin = Double.valueOf(goget).doubleValue();
else
demandmin = -2;
}
catch(NumberFormatException e) {
demandmin = -3;
}

What would I need to change in order to pass an array of doubles' instead of just one. Thanks in advance for all the help, it's really appreciated. --Alan
 
Well you could make a delimited field value and then use java.util.StringTokenizer to parse the string into an array.

Code:
param name=&quot;DemandMin&quot; value=&quot;99.1,72.5,14.336&quot;>
does that help?

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top