View Full Version : Quick Mel Question

09 September 2010, 04:57 PM
What is the difference between the ` apostrophe and ' apostrophe in MEL? Thnaks

09 September 2010, 06:11 PM
the ` is not actually an apostrophe, it's called "backtick" and it's a special character that denotes to MEL that you want the return value (Result) of the code within. e.g.

string $selection[] = `ls -sl`;the ' is simply a standard single quote/apostrophe charater and has absolutely no special significance in MEL whatsoever. the ' is only ever used in MEL as a standard character in user strings. e.g.

string $literal = "Don't have a cow Man!";:nathaN

10 October 2010, 12:58 PM
in py however the ' is used as quotation mark but can be exchanged to the " as well. Is that correct Nathan?var1 = 'some text'
var2 = "some text"
if var1 == var2:
print 'yep its the same!'

var3 = 'you can "quote" without escaping!'
var4 = "you can 'quote' without escaping!"
# does NOT work of course:
var5 = "you can "quote" without escaping!"
var6 = 'you can 'quote' without escaping!'

10 October 2010, 03:59 PM
This should go without saying, but for completeness, they are only exchangeable in pairs.
# okay:
var1 = 'some text'
var2 = "some text"
#not okay:
var3 = 'some text"
var4 = "some text'

CGTalk Moderation
10 October 2010, 03:59 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.