Availability: |
| |||
JavaScript syntax: | IE | myVBArray = new VBArray() | ||
IE | myVBArray = new VBArray(aVisBasArray) | |||
IE | myVBArray = VBArray | |||
Argument list: | aVisBasArray | An array created inside Visual Basic or VBScript | ||
Object methods: | dimensions(), getItem(), lbound(), toArray(), ubound() |
Because VBScript is only available on the Windows platform, this object has limited use in portable applications.
You might find it useful in an intranet scenario where you have total control over which browsers are deployed to the users. In that case, you know that your pages will be viewed on a compatible platform and can happily use this object with impunity.
Because the Visual Basic interpreter is only available on a limited number of platforms, this functionality is likely to be limited only to those pages that need to work on the MSIE browser in a Windows environment. This technique is unlikely to work in any other context.
<!-- An example taken from Wrox: Professional JavaScript --> <SCRIPT LANGUAGE="VBScript"> function getArray() dim arrVB(1) arrVB(0) = 100 arrVB(1) = 250 getArray = arrVB End function </SCRIPT> <SCRIPT LANGUAGGE="JavaScript"> var vbArr = new VBArray(getArray()); </SCRIPT>
Method | JavaScript | JScript | N | IE | Opera | NES | ECMA | DOM | CSS | HTML | Notes |
---|---|---|---|---|---|---|---|---|---|---|---|
dimensions() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
getItem() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
lbound() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
toArray() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
ubound() | ![]() | 3.0 ![]() | ![]() | 4.0 ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | - |
Prev | Home | Next |
Variable statement | Up | VBArray() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |