Arrays in VB6

From: Bob (anonymous_at_discussions.microsoft.com)
Date: 05/31/04


Date: Sun, 30 May 2004 19:36:46 -0700

Unlike VBScript, the arrays in Javascript are objects that
have methods and properties. The following example defines
an array in Javascript. How can I achieve the same in
VBScript? Can someone convert the following function
(arrayTest ()) defined in Javasctipt to its equivalent in
VBScript and/or in VB6?

To understand the function, create an HTML file with the
following and open the file:

Thanks in advance,
Bob

<html>
<head>
<script language="javascript">
function arrayTest()
{
        var i;
        symbols = [{person:"Bob", age:"26",
gender:"male"}, {person:"Amy", age:"23",
gender:"female"}]

        alert(symbols.length);
        for (i=0; i<symbols.length; i++)
        {
                alert(symbols[i].person);
                alert(symbols[i].age);
                alert(symbols[i].gender);
        }
}
</script>
</head>
<body onload="arrayTest()">
    Testing for Arrays in javascript
</body>
</html>



Relevant Pages

  • Object instead of array? Any problems?
    ... Javascript isn't my specialty, ... TONS of arrays, and I'm using vbscript to actually build them into the ... lol - it's a mess. ...
    (comp.lang.javascript)
  • Re: Arrays in VBScript
    ... "Bob" wrote in message news:155a301c446b7$60d3a8a0$a401280a@phx.gbl... ... Unlike VBScript, the arrays in Javascript are objects that ... : an array in Javascript. ... Testing for Arrays in javascript ...
    (microsoft.public.scripting.vbscript)
  • Arrays in VB6
    ... Unlike VBScript, the arrays in Javascript are objects that ... an array in Javascript. ... create an HTML file with the ... Testing for Arrays in javascript ...
    (microsoft.public.vb.syntax)
  • Arrays in VBScript
    ... Unlike VBScript, the arrays in Javascript are objects that ... an array in Javascript. ... create an HTML file with the ... Testing for Arrays in javascript ...
    (microsoft.public.scripting.vbscript)
  • Re: Arrays in VB6
    ... especially objects acts mostly very different from ... > an array in Javascript. ... > VBScript and/or in VB6? ... create an HTML file with the ...
    (microsoft.public.dotnet.languages.vb)