Beginner VB

Moderators: None (Apply to moderate this forum)
Number of threads: 1244
Number of posts: 2990

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
help again... Posted by gioanne on 13 Jan 2009 at 7:21 PM
help again...wat does subscript out of range mean???help me please......
Report
Re: help again... Posted by shasur on 15 Jan 2009 at 12:05 AM
It occurs mostly in arrays when you declare the array to hold 'n' elements but try to retrieve n+1 element

For example

Sub FillArray()

Dim Array2D(1 To 2, 1 To 2) As String

Array2D(1, 1) = "One and One"
Array2D(1, 2) = "One and Two"
Array2D(1, 3) = "Error "
Array2D(2, 1) = "Two and One"
Array2D(2, 2) = "Two and Two"

End Sub


Array2D(1, 3) throws an error as the array is (2,2) one and the third element doesn't exist


VBA Tips & Tricks (http://vbadud.blogspot.com)

C# Code Snippets (http:dotnetdud.blogspot.com)



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.