Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Expected end of statement

Status
Not open for further replies.

wallm

Programmer
Apr 4, 2005
69
GB
myString="<a href="If TestFunction(myString)= True Then
..............


causes an expected end of statement error.
How can I use the replace function to stop the " in the link causing the error? I don't want to use ' the single quote.

thanks.
 
You have a few options:
1) you can escape the double quotes with double double quotes, as Nick suggested
2) You can use single quotes
3) you can use single quotes or any other character then repace them with double quotes
4) You can concatenate in Chr(34): "<a href=" & Chr(34) & "
You cannot just put them in the string inline, as VBScript treats them as beginning and end of string characters.


Personally I use double double quotes, just like Nick, but it's up to you.
-T

 
ok thanks for those suggestions guys.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top