Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


string manipulation

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,759
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> string manipulation
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 string manipulation - 1/16/2003 6:37:22 AM   
  tomk

 

Posts: 2
Score: 0
Joined: 1/16/2003
From: United Kingdom
Status: offline
Hi all,
I'm trying to load a file which contains html tags, parse through that file for some 'special' tags grab the data between those tags then write it out.

Problem is, the parsing works fine when testing with a single line test string but doesn't when using the imported file's contents. Code is as follows:
 Function ParseTags(findBeg, findEnd, myString) 
     DIM myBeg, myEnd, b, bb, e, ee

     myBeg = InStr(myString, findBeg) + Len(findBeg)

     myEnd = InStr(myBeg, myString, findEnd) 
     If myBeg > 0 And myEnd > myBeg Then

ParseTitle = Trim(Mid(myString, myBeg, myEnd - myBeg))

     Else           

           ParseTags = "ERROR: "

       End If
 
End Function

FileName = Server.MapPath(Request.QueryString("ID"))

 strFileContent = CreateObject("Scripting.FileSystemObject").OpenTextFile(FileName, 1, False, False).readall

 Response.Write  ParseTags("", "", strFileContent)
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> string manipulation Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts