Arrays in VB6

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

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.person);
alert(symbols.age);
alert(symbols.gender);
}
}
</script>
</head>
<body onload="arrayTest()">
Testing for Arrays in javascript
</body>
</html>
 
Hi Bob,

This is a VB.net group, especially objects acts mostly very different from
VBS and classic VB.

In VB.net everything are objects or predefined values.

You can better ask this in a VB classic newsgroup there are a lot see the *.

microsoft.public.VB*

I hope you find your solution.

Cor
 
Back
Top