|
-
May 7th, 2010, 11:47 AM
#1
Thread Starter
Frenzied Member
help mixing varibles with html
Hi all i am trying to use the 3 varible call Line1,Line2,Line3 and keep getting syntax error . could you guys help me fix it .Thanks
Code:
Dim htm2 As String
html2 = "<li>" & _
"<a href=" "&sLine1& "">" & _
"<img src=""&sLine2& "" alt="" /><br />"&sLine3& "</a><br />" & _
"</li><li>"
RichTextBox1 = html2
Last edited by tony007; May 7th, 2010 at 12:04 PM.
-
May 7th, 2010, 12:01 PM
#2
Re: help mixing varibles with html
You say they are named Line1, Line2, Line3 but I only see you use sLine1 and sLine2.
Also, you need spaces before and after & when doing string concatenation. And when you want to use a quotes character inside a quoted string you have to double it. For example: MsgBox """" will only display: "
Try this corrected code:
Code:
html2 = "<li>" & _
"<a href=""" & sLine1 & """>" & _
"<img src=""" & sLine2 & """ alt="""" /><br />" & sLine1 & "</a><br />" & _
"</li><li>"
Last edited by baja_yu; May 7th, 2010 at 12:04 PM.
-
May 7th, 2010, 12:06 PM
#3
Thread Starter
Frenzied Member
Re: help mixing varibles with html
 Originally Posted by baja_yu
You say they are named Line1, Line2, Line3 but I only see you use sLine1 and sLine2.
Also, you need spaces before and after & when doing string concatenation. And when you want to use a quotes character inside a quoted string you have to double it. For example: MsgBox """" will only display: "
Try this corrected code:
Code:
html2 = "<li>" & _
"<a href=""" & sLine1 & """>" & _
"<img src=""" & sLine2 & """ alt="""" /><br />" & sLine1 & "</a><br />" & _
"</li><li>"
i edited my above post.how to use them inside such html ?
-
May 7th, 2010, 12:15 PM
#4
Re: help mixing varibles with html
-
May 8th, 2010, 03:05 PM
#5
Thread Starter
Frenzied Member
Re: help mixing varibles with html
Thanks it worked but how to do like this adding http before sLine1?
Code:
"<a href="http://www.somesite.com/id="" & sLine1 & """>" & _
-
May 8th, 2010, 07:02 PM
#6
Re: help mixing varibles with html
Read what I said about using quotes in strings (within quotes)
if you want to write: <a href="http://www.somesite.com/id="
to a string you have to double up those qoutes, so it would look like
strA = "<a href=""http://www.somesite.com/id="""
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|