Thunderstone
Site Admin
Posts: 2504 Joined: Wed Jun 07, 2000 6:20 pm
Post
by Thunderstone » Wed Oct 21, 1998 10:51 am
How do you escape quotes within double quoted strings?
I want the following result:
<!--#include virtual="public/head.htm"-->
using <send "<!--#include virtual="public/head.htm">
The quotes MUST be included within a double quoted string
literal since I have to use send within an <exec> to get our SSI
to function properly.
Thunderstone
Site Admin
Posts: 2504 Joined: Wed Jun 07, 2000 6:20 pm
Post
by Thunderstone » Wed Oct 21, 1998 11:14 am
Same way as in HTML: use single quotes to enclose the string instead of
double quotes.
Use: <send '<!--#include virtual="public/head.htm">'>
I don't know what your overall goal is, but check to see if
it can be accomplished entirely withing the Vortex script, perhaps with
<spew> to send files or <fetch> for URLs. In general you should think
carefully before <EXEC>ing another program or using SSI, because these
incur additional overhead and parsing that may not be necessary.
-Kai
hillman
Posts: 25 Joined: Mon Apr 08, 2002 9:06 am
Post
by hillman » Wed Sep 13, 2006 9:41 am
Doesn't seem to work within a fmt or strfmt function?
<strfmt '<A HREF="$s">%s</A><br />' $URL $TITLE>
... produces:
Argument must be single variable or literal in the function: ()
I also tried:
<sum %s '<A HREF="' $URL '">' $TITLE '</A><br />'>
... and got:
Missing start double quotes in function: ()
hillman
Posts: 25 Joined: Mon Apr 08, 2002 9:06 am
Post
by hillman » Wed Sep 13, 2006 9:53 am
Sorry, my mistake! The first example does work, it's just I mixed a '$' for a '%' in the first %s.
John
Site Admin
Posts: 2616 Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:
Post
by John » Wed Sep 13, 2006 9:53 am
You want:
<strfmt '<A HREF="%s">%s</A><br />' $URL $TITLE>
To print the URL in the function with a fmt code.
To get a dollar sign in a string literal you need to double it up.
John Turnbull
Thunderstone Software