File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes constructing array name Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "constructing array name" Watch "constructing array name" New topic
Author

constructing array name

Alex DeLaad
Greenhorn

Joined: Jan 09, 2002
Posts: 3
hi,
i have a few arrays called
menu1, menu2, menu3 etc.......
In a function I wish to create the array name by a variable passed in, so that i can dynamically create the array name.

If anyone could help please
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
use a multideminsional array instead
var Menu = new Array()
Menu[1] = new Array()
Menu[2] = new Array()
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
Or you can use "eval" and do something like this:

Note: change "e-val" to "eval" and "on-Click" to "onClick"
 
 
subject: constructing array name
 
Threads others viewed
howto make html:link dynamic select item of map ?
browser back button problem.
how to iterate list in a table using jstl
i need space between menus ...
Generating Horizontal Menu in JSF using h:dataTable
MyEclipse, The Clear Choice