To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 7021
7020  |  7022
Subject: 
Re: R: Save arrays in VB5
Newsgroups: 
lugnet.robotics
Date: 
Mon, 27 Sep 1999 13:26:48 GMT
Original-From: 
Joel Shafer <joel@connect!nospam!.net>
Viewed: 
407 times
  
At 10:12 AM 9/27/99 +0100, you wrote:
If you dimension an array of (say) 100 elements as : DIM a(100) as integer
the array elements goes from 0 to 99, for a total of 100. So if
your loop searches for a 100th elements it comes out with the
"subscript out of range" error. Either restate the loop or esplicitly
dim the array differently using the keyword "to" as : DIM a(1 TO 100) as
integer.

regards
Roberto

Actually, when you say Dim a(100) as integer, the array contains 101
elements ranging from element 0 to element 100.  By default VB starts
arrays at the 0th element (this can be changed).  The Dim statement for
arrays doesn't specify the number of elements as you would suppose, but
rather specifies the upper boundary of the array.


Joel Shafer    joel@connect.net



Message has 1 Reply:
  R: R: Save arrays in VB5
 
Fantastic. All this time I believed it wrong. I checked and of course it's true, either on VB and on old QB. Thanks for that. Roberto -----Messaggio Originale----- Da: Joel Shafer <joel@connect.net> A: Roberto Amato <RobertoAmato@mclink.it> Cc: (...) (25 years ago, 6-Oct-99, to lugnet.robotics)

Message is in Reply To:
  Save arrays in VB5
 
Does anyone know how to save an array in VB5? I have tried a for loop, but it always says subscript out of range. It shouldn't be out of range since I know how big the array is. Can anyone help? This is for a 2 step scanner program. (25 years ago, 24-Sep-99, to lugnet.robotics)

5 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR