Results 1 to 3 of 3

Thread: file searching

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    60
    Hello,

    I am writing a program in VB6 in which I need to open a text file and search for and words contained in brackets like this: <word>. As each word is found, I need to put the word into a string variable array for later use. Any code or suggestions would be greatly appreciated.


  2. #2
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305
    i can't give u much help but search for str function in the help section of vb ... i think it allows u to search for a character in a string ... if not then then look for the split function

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    dim buffer as string,arr() as string,x as long
    open file for binary as 1
      buffer=space(lof(1))
      get#1,,buffer
    close1
    buffer=left(buffer,instr(buffer,"<")+1)
    arr=split(buffer,"<")
    for x=0 to ubound(arr)
      arr(x)=left(arr(x),instr(buffer,">")-1)
    next x
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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