Arrays in VB6
From: Bob (anonymous_at_discussions.microsoft.com)
Date: 05/31/04
- Next message: Arne Janning: "Re: Ask about the resource file"
- Previous message: Ray: "Ask about the resource file"
- Next in thread: Cor Ligthert: "Re: Arrays in VB6"
- Reply: Cor Ligthert: "Re: Arrays in VB6"
- Messages sorted by: [ date ] [ thread ]
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>
- Next message: Arne Janning: "Re: Ask about the resource file"
- Previous message: Ray: "Ask about the resource file"
- Next in thread: Cor Ligthert: "Re: Arrays in VB6"
- Reply: Cor Ligthert: "Re: Arrays in VB6"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|