Hi,
"nobody" <no****@non.exi ste.nt> wrote in message
news:XB******** *************@n ews.chello.at.. .
| hello,
|
| thanks Vjekoslav and Elias. do you know any solution, that would also
| work under Windows Scripting Host?
original message:
is there a way of creating an array with help of a function that would
accept the name of this array as a parameter and then create global
Array type variable of that name?
so that for example the following code would work as well in browsers as
under Windows Scripting Host:
---
While you're looking for a JS solution, you may want to consider ...
This is easy in VBS - not sure about JS. Although undocumented, the VBS
Execute statement will create a new global variable (despite any Option
Explicit statement), if it does not find the variable name referenced in
either its immediate local variable list or the global variable list. So
the following should work (air code):
sub NewArray (rsArrayName)
execute "dim " & rsArrayName & "()"
end sub
Just Redim after the call, as needed, or you could incorporate the
dimensions and bounds through an additional string parameter, if you wish.
You can wrap the code in On Error ... statements, if you're worried about
potentially Dimming an existing array. You can mix JS and VBS in HTML or
WSC wrappers.
Joe Earnest
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.521 / Virus Database: 319 - Release Date: 09-23-03