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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th February 2004, 22:48   #1  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 831
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.
WarpEnterprises is offline   Reply With Quote
Old 25th February 2004, 23:33   #2  |  Link
mf
 
mf's Avatar
 
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.
mf is offline   Reply With Quote
Old 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.
stickboy is offline   Reply With Quote
Old 26th February 2004, 16:29   #4  |  Link
WarpEnterprises
C64
 
WarpEnterprises's Avatar
 
Join Date: Apr 2002
Location: Austria
Posts: 831
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.
WarpEnterprises is offline   Reply With Quote
Old 28th February 2004, 21:22   #5  |  Link
mf
 
mf's Avatar
 
Join Date: Jan 2002
Posts: 1,729
Updated the wiki . If anyone finds my wording too bad feel free to change it .
mf is offline   Reply With Quote
Old 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)
bill_baroud is offline   Reply With Quote
Old 28th February 2004, 22:06   #7  |  Link
mf
 
mf's Avatar
 
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.
mf is offline   Reply With Quote
Old 28th February 2004, 22:13   #8  |  Link
bill_baroud
Registered User
 
Join Date: Feb 2002
Posts: 407
ah ok, thanks
bill_baroud is offline   Reply With Quote
Old 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")
stickboy is offline   Reply With Quote
Old 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.
Comatose is offline   Reply With Quote
Old 10th December 2007, 04:29   #11  |  Link
Spuds
dumber every day
 
Spuds's Avatar
 
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...
Spuds is offline   Reply With Quote
Old 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 View Post
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.
stickboy is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2017, vBulletin Solutions Inc.