home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,910 of 10,840   
   Steve Gerrard to Paul M. Cook   
   Re: Null values in variant array   
   24 Feb 06 19:01:41   
   
   From: mynamehere@comcast.net   
      
   "Paul M. Cook"  wrote in message   
   news:w1NLf.92$pE4.64@trnddc04...   
   > Let's say you have a CSV file and you load it into a variant array using the   
   > split function on VBCrLF.  Then you load a variable with the line count and   
   > loop through the array for 0 to line count.  This works well unless you have   
   > blank lines at the end of the CSV file.  Now if you process the loop, you'll   
   > get an out of bounds subscript at the end of the loop because you are   
   > referencing null values at the end of the variant array.   
   >   
   > How would you go about stripping the extraneous CRLFs from the end of the   
   > file?   
   >   
      
   If it is just an out of bounds subscript, then use UBound(MyArray) instead of   
   the line count. That will tell you how many actual array entries you have.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca