Results 1 to 2 of 2

Thread: arrays

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Posts
    168
    Hello,

    Is there a quick way to compare a string against an array of strings to see if it exists without having to loop through? Also, what is the max count an array can have and what is the longest string it can hold?

    Code:
    Dim myArray() As String
    
    Do Until rs.EOF
      'check rs![Field1] vs array, if it does not exist then add it
      rs.MoveNext
    Loop
    Thanks,
    Thai

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    If the array is sorted you could use a binary search technique which could speed things up enormously. Otherwise you need to check them all.

    As for size... I'd worry more about running out of RAM than exhausting the limits (probably about 32bit signed, so 2gb strings and 2 billion (ish) array entries).
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width