Array Problem 
Author Message
 Array Problem

Please try the following code.  It's a simple code but I can't get it to
work.

Sub ShowArrayType()
    Dim a(1)
    a(0) = "123"
    a(1) = "456"
    Msgbox VarType(a())    'this line will give me "subscript out of range"
error.
End Sub

I tried these code on couple of my machine and I believe that I have the
lastest scripting engine for my IE4.
Please help!!!



Mon, 26 Feb 2001 03:00:00 GMT  
 Array Problem
Hello Raymond ...

pass only the array name, without parentheses.
If you want to see the VarType you should call Response.Write instead of
MsgBox

Sub ShowArrayType()
     Dim a(1)
     a(0) = "123"
     a(1) = "456"
     Response.Write VarType(a)
End Sub

HTH

Joseph

--

**************************************
Joseph Toulier Pighi

+51 (1) 909-9339
Lima - Peru

Quote:

> Please try the following code.  It's a simple code but I can't get it to
> work.

> Sub ShowArrayType()
>     Dim a(1)
>     a(0) = "123"
>     a(1) = "456"
>     Msgbox VarType(a())    'this line will give me "subscript out of range"
> error.
> End Sub

> I tried these code on couple of my machine and I believe that I have the
> lastest scripting engine for my IE4.
> Please help!!!



Mon, 26 Feb 2001 03:00:00 GMT  
 Array Problem

Quote:

>Please try the following code.  It's a simple code but I can't get it to
>work.
>Sub ShowArrayType()
>    Dim a(1)
>    a(0) = "123"
>    a(1) = "456"
>    Msgbox VarType(a())    'this line will give me "subscript out of range"
>error.
>End Sub

Depending on what you are looking for:
Msgbox VarType(a(0))
or
Msgbox VarType(a)


Tue, 27 Feb 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Array to Variant and Variant to array problem

2. array problem

3. VB6 -> VB.NET (Passing Array Problem)

4. Filter and Array problem

5. Array problems

6. pic array problems

7. Array problem

8. subscript out of range? (floating array problem)

9. ARRAY PROBLEM

10. Array Problem - Total Count?

11. Array problem with a dynaset

12. Control Array Problem

 

 
Powered by phpBB® Forum Software