Results 1 to 5 of 5

Thread: 2 hopefully simple things.

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    2 hopefully simple things.

    Hi.
    Im makin a simple program to write some html code out.

    I need to know how to do 2 thing's.

    1) how do i write " into the code without having it Error on me ?

    at the moment it is

    VB Code:
    1. temp = "<body bgcolor=" & textbg &"alink=" & text1 & " vlink=" & text2 & " >"

    but i want it to go to the html = of

    <body bgcolor="textbg" alink="text1" vlink="text2" >

    but i know if i add the " just like

    temp = "<body bgcolor="" & textbg ....

    it will error

    any help?

    2)

    i want to add new lines into it, via the code. so it look like standart html code.

    <html>
    <head>
    <title> text title </title>
    </head>

    Please help.

    Wayne
    Wayne

  2. #2
    Lively Member
    Join Date
    Mar 2001
    Location
    *.*
    Posts
    85
    use chr(34) for quotes and vbnewline for guess what...
    hth
    Everytime

    "I'm not normally a religious man, but if you're up there, save me, Superman!" Homer Simpson

    Visit my site

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: 2 hopefully simple things.

    TRY

    1)
    Code:
    temp = "<body bgcolor=""" & textbg ....
    2)
    Code:
    use vbcrlf constant to break to a new line

  4. #4
    Addicted Member
    Join Date
    Feb 2001
    Location
    Upstate NY
    Posts
    210
    Question # 1:
    You can use double quotes or Chr(34) to put a quote in your code
    msgbox "He""llo"
    the above would print He"llo
    or you can do this:
    msgbox "He" & chr(34) & "llo"
    which would also print He"llo

    Question #2:
    you can use the vbCrLf to make newlines
    msgbox "First Line" & vbcrlf & "Second Line" & "still Second line" & vbcrlf & "Third Line"


    Hope this helped
    -George
    < o >

  5. #5
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    This is what I do for the header info (Note it includes a variable called budget, and built in varaible Date).

    VB Code:
    1. Print #1, "<html>"
    2.     Print #1, "<body bgcolor=#FFFFFF>"
    3.     Print #1, "<p><b>"
    4.     Print #1, "<h1 align=center><font><font face= Tahoma color= YELLOW size=6>Main App.</font></h1>"
    5.     Print #1, "<h2 align=center><font><font face= Tahoma color= RED size=4>Project Professional</font></h2>"
    6.     Print #1, "<h3 align=center><font><font face= Tahoma color= WHITE size=4>Budget Analysis</font></h3>"
    7.     Print #1, "<h3 align=center><font><font face= Tahoma color= WHITE size=4>" & BUDGET & "</font></h3>"
    8.     Print #1, "<h3 align=center><font><font face= Tahoma color= WHITE size=2> as of " & Date & "</font></h3>"
    9.     Print #1, "<hr><br>"

    Remember, the extra quotes ca cause you nightmares...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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