Thread: Vb And Html
View Single Post
Old Sep 10th, 2004, 11:34 AM   #6
Pizentios
Programming Guru
 
Pizentios's Avatar
 
Join Date: May 2004
Location: Brandon, Manitoba, Canada
Posts: 2,023
Rep Power: 7 Pizentios is on a distinguished road
Send a message via ICQ to Pizentios Send a message via MSN to Pizentios
Herečs a function that will return the text between your two markers.



function grabtext(filename, search as string) as variant

dim check as boolean
dim text() as string
dim tmp() as string
dim read as string
dim y, x as integer

read = Space(FileLen(filename))
Open filename For Binary As #1
  Get #1, 1, read
Close #1

tmp() = Split(read, vbCrLf)

check = false

y = 0
x = 0

for x=0 to UBound(tmp)
    if (tmp(x) == search) then
        check = true
    else
        check = false
    end if
   
    if (check = true) then
        text(y) = tmp(x)
        y = y + 1
    end if
Next x
   
return text()

end function


Anyways, this code has not been tested yet at all, so there could be bugs in it. Good luck.
__________________
Profanity is the one language that all programmers understand.

Check out my Blog <---updated Nov 30 2007!
Pizentios is offline   Reply With Quote