trixmoto wrote:When displaying punctation in html you should use & codes. For example:
[ ] (Space) = &nbps;
['] (Single quote) = '
["] (Double quote) = "
I understand that, but how do I tell the script to output the filename and IF it contains quotes print them as well? It is the script that is choking on the puntuation, not the html file being output.
For example here is the line of code that prints the full path to the file.
gettrack = Replace(gettrack,"<Filename>","<td>"&path&"</td>")
For example using the code above:
#1 No quotes and outputs the filename to the html.
Code: Select all
Path: c:\music\thenameofasong.mpg
outputs: <td>c:\music\thenameofasong.mpg</td>
#2 Quotes and does not output the filename to the html.
Code: Select all
Path: c:\music\thename'ofasong.mpg
outputs: <td>c:\music\thename</td>
#3 Quotes and does not output the filename to the html.
Code: Select all
Path: c:\music\thename'of'asong.mpg
outputs: <td>c:\music\thename</td>
I want #2 and #3 to be able to do this instead:
Quotes and outputs the filename to the html.
Code: Select all
Path: c:\music\thename'ofasong.mpg
outputs: <td>c:\music\thenameofasong.mpg</td>
Quotes and outputs the filename to the html.
Code: Select all
Path: c:\music\thename'of'asong.mpg
outputs: <td>c:\music\thenameofasong.mpg</td>
Since a lot of song titles have one our more ' in them this causes a problem when trying to get the script to output the name of a file to the html.
If the filename contains any quotes then the path is only printed until the first quote and nothing after that is output to the html. But if the filename does not contain quotes then it outputs it just fine.
How do I tell them script to check for quotes in the filename and if it contains them to print them to the html?
See my problem?
I know how to do this using PHP or Perl but don't know enough about VB scripting to do it.