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 / 6999
  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)
 
  Re: Save arrays in VB5
 
(...) Try this: dim i as integer for i=lbound(myarray) to ubound(myarray) <save the array element myarray(i) > next i Joel Shafer joel@connect.net (25 years ago, 24-Sep-99, to lugnet.robotics)
 
  R: Save arrays in VB5
 
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 (...) (25 years ago, 27-Sep-99, to lugnet.robotics)
 
  Re: R: Save arrays in VB5
 
(...) 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 (...) (25 years ago, 27-Sep-99, to lugnet.robotics)
 
  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)

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