Arrays in VB6

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>
 
C

Cor Ligthert

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top