Log in

View Full Version : [script syntax] Escape quotes, how ?


mf
25th March 2003, 22:35
I've looked all over the avisynth.org manual, but no results. The backslash is used for something else (line splitting) and doesn't work.

Eval( "Subtitle(" + DoubleWidth + ", 100, 200, 0, 999999, "Arial", 24, $00FF00)" )
gives me "Script Error: expected a , or ) (G:\vd_op_decomb.avs line 94, column 64)".

DDogg
26th March 2003, 04:29
I think the easiest way is to use WarpE's chr.dll He wrote it for solving problems like this. It is buried in here: http://forum.doom9.org/showthread.php?s=&threadid=47972&highlight=Syntax+Q+filter+args+as+a+variable
&
http://www.avisynth.org/~warpenterprises/

mf
26th March 2003, 08:48
Something external ? Why not escape characters ?


Eval( "Subtitle(" + DoubleWidth + ", 100, 200, 0, 999999, \"Arial\", 24, $00FF00)" )
would solve the problem. Or if you really can't use backslashes, you could use a rarely used char like ~.

DDogg
26th March 2003, 09:38
I thought you were speaking of the quotes within quote problem, sorry.

mf
26th March 2003, 09:53
Originally posted by DDogg
I thought you were speaking of the quotes within quote problem, sorry.
Yes, I am, but unix and programming languages solved that with the escape char. If I want to echo " ", then if I do this:
echo " "
I get a single space, because it parses the quotes. If I do this:
echo \" \"
I get two quotes. The escape char means "do not parse next character". Then how do you place a backslash ? Simple: \\ means "do not parse next escape character" :D.

WarpEnterprises
27th March 2003, 14:31
creating a CHR() function was much easier than changing the parser and maybe can be used for other tasks, too.

mf
27th March 2003, 15:50
Originally posted by WarpEnterprises
creating a CHR() function was much easier than changing the parser and maybe can be used for other tasks, too.
But an escape char fixes ALL such parsing problems, not just with quotes.

WarpEnterprises
27th March 2003, 16:07
but chr(n) returns any ascii character ...
(the one on the web page, not the one in the thread)

:)

mf
29th March 2003, 14:36
Originally posted by WarpEnterprises
but chr(n) returns any ascii character ...
(the one on the web page, not the one in the thread)

:)
Still then, I consider it a problem in the scripting language, which should be fixed in the scripting parser, and not in an external plugin.