Results 1 to 3 of 3

Thread: Strings

  1. #1

    Thread Starter
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Question

    I'm making an HTML editor for a company I'm working for, and I'm having trouble with a certain aspect of the reloading of the html files. My editor is for the laymen, I put several fields in it, such as the title, body, headers, etc. So it's not for people that know how to use HTML. What I need is a function that will split up the html file into these parts. Specifics aren't really needed, if someone can just get me some code I'm confident that I can modify it to suit my needs.
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    The basics for you then.

    Find [HEAD] and [/HEAD] with instr.

    Then use mid$ to return that part of the file.

    Code:
    Dim ipHead as Long
    Dim ipHeadEnd as Long
    Dim strHead as String
    Dim iLength as Long
    
    ipHead = instr(1, strHTMLFILE, "[HEAD]", vbTextCompare)
    ipHeadEnd = instr(1, strHTMLFILE, "[/HEAD]", vbTextCompare)
    
    iLength = len(ipheadEnd) + ipHeadEnd - ipHead
    
    strHead = mid$(strHTMLFILE, ipHead, iLength)
    I think that is right, though i haven't tested it.
    Iain, thats with an i by the way!

  3. #3
    Guest
    html code is off, so you can use
    <>

    <head>
    </head>

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