<SCRIPT LANGUAGE="VBSCRIPT">
Function makeArrayVB()
' Creates a VBScript array
dim anArray(1,1)
anArray(0,0) = "0,0"
anArray(0,1) = "0,1"
anArray(1,0) = "1,0"
anArray(1,1) = "1,1"
makeArrayVB = anArray
End Function
<SCRIPT LANGUAGE="JavaScript">
// Accesses a VBScript array within a JScript script
function getVBArray(){
var arrayObj;
var jsArray;
arrayObj = makeArrayVB();
jsArray = VBArray(arrayObj).toArray();
alert("VBScript array length = " + jsArray.length);
// Displays the contents of the array
for(i=1;i<=jsArray.length;i++) {
alert(jsArray[i-1]);
}
}
</SCRIPT>
<SCRIPT LANGUAGE="VBSCRIPT"> Function makeArrayVB() ' Creates a VBScript array dim anArray(1,1) anArray(0,0) = "0,0" anArray(0,1) = "0,1" anArray(1,0) = "1,0" anArray(1,1) = "1,1" makeArrayVB = anArray End Function <SCRIPT LANGUAGE="JavaScript"> // Accesses a VBScript array within a JScript script function getVBArray(){ var arrayObj; var jsArray; arrayObj = makeArrayVB(); jsArray = VBArray(arrayObj).toArray(); alert("VBScript array length = " + jsArray.length); // Displays the contents of the array for(i=1;i<=jsArray.length;i++){ alert(jsArray[i-1]); } } </SCRIPT>
No comments:
Post a Comment