Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 Doom9's Forum did you know: string containing quotes
 Register FAQ Calendar Search Today's Posts Mark Forums Read

25th February 2004, 22:48   #1  |  Link
WarpEnterprises
C64

Join Date: Apr 2002
Location: Austria
Posts: 830
did you know: string containing quotes

Up today I didn't knew a way to type a string containing quotes.
Well, you can use chr(34), but that's not really short.

I always wondered about the following sentence in the original docu from BenRG:

Quote:
 A text string is surrounded either by "quotation marks" or by TeX-style quotes''. A text string can contain any character except the terminating quotation mark or double-apostrophe. If you need to put a quotation mark inside a string, use the TeX-style notation.
Well, I never figured out what he meant with TeX-style, because no combination of ' or  or " worked. So today I looked in the source code - and the solution (which was there since the first day) is THAT SIMPLE:

e.g.

Subtitle(""" now you can put as many " in here as you like""")

TeX-Style = Use three quotes at the beginning and the end and you can put in the string single quotes.

25th February 2004, 23:33   #2  |  Link
mf
·

Join Date: Jan 2002
Posts: 1,729
Then why the hell did he say:
Quote:
 TeX-style quotes''
Cause that's definitely different from three quotes.

 26th February 2004, 03:52 #3  |  Link stickboy AviSynth Enthusiast   Join Date: Jul 2002 Location: California, U.S. Posts: 1,268 Cool! AFAIK, TeX does not use the (Python-style?) triple-quote system. As implied by the documentation, TeX uses two backticks () followed by two apostrophes (''), but that functionality appears to be broken in AviSynth. I can't say I miss it, and I think it's better as it currently is. TeX-style quotes aren't common outside of TeX, and I prefer canonical syntax over having multiple ways of representing string literals.
 26th February 2004, 16:29 #4  |  Link WarpEnterprises C64     Join Date: Apr 2002 Location: Austria Posts: 830 Now I found why it's in the old doc: because that was the way it worked in AviSynth 0.3 - and in 1.03 it was changed to the new way.
 28th February 2004, 21:22 #5  |  Link mf ·     Join Date: Jan 2002 Posts: 1,729 Updated the wiki . If anyone finds my wording too bad feel free to change it .
 28th February 2004, 22:03 #6  |  Link bill_baroud Registered User   Join Date: Feb 2002 Posts: 407 just a thought .... "a string with \"quotes\"" doesn't work ? i always do something like this when needed (not in avisynth though, more in C, java or unix shell)
 28th February 2004, 22:06 #7  |  Link mf ·     Join Date: Jan 2002 Posts: 1,729 Nope. Escaping was also the first thing I tried, but the \ sign is already taken for line wrapping.
 28th February 2004, 22:13 #8  |  Link bill_baroud Registered User   Join Date: Feb 2002 Posts: 407 ah ok, thanks
 28th February 2004, 22:22 #9  |  Link stickboy AviSynth Enthusiast   Join Date: Jul 2002 Location: California, U.S. Posts: 1,268 I don't think the fact that \ is the line continuation character should be problem. It's only a line continuation character outside of a string. (After all, it's also the line continuation character in C!) I think the bigger issue is that using it as an escape character will break existing scripts that use it in paths. For example: Code: AVISource("C:\bar\foo.avi") # \b shouldn't be a backspace frequentPath = "C:\bar\" # we don't want the quote to be escaped Import(frequentPath + "baz.avs")`
 9th December 2007, 23:37 #10  |  Link Comatose Registered User   Join Date: Dec 2007 Posts: 639 Simple: C:/bar/ edit: Er, uh, sorry... didn't notice this thread was from '04.
10th December 2007, 04:29   #11  |  Link
Spuds
dumber every day

Join Date: Dec 2006
Location: Planet Earth
Posts: 154
Quote:
 Simple: C:/bar/ edit: Er, uh, sorry... didn't notice this thread was from '04.
Humm first post .. perhaps f:/ubar/ would have been more appropriate...

11th December 2007, 11:26   #12  |  Link
stickboy
AviSynth Enthusiast

Join Date: Jul 2002
Location: California, U.S.
Posts: 1,268
Quote:
 Originally Posted by Comatose Simple: C:/bar/ edit: Er, uh, sorry... didn't notice this thread was from '04.
You totally missed the point anyway, which is not to break already-existing scripts.

If you ignore that requirement, sure, you can do whatever the hell you want.