Share this post

Link to post

Share on other sites

Nahuel 1

Nahuel 1

Strings are enclosed in double-quotes like "this". If you want a string to actually contain a double-quote use it twice like:

"here is a ""double-quote"" - ok?"

You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'

You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:

'This "sentence" contains "lots" of "double-quotes" does it not?'

is much simpler than:

"This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"

According to the help file, there seems to be no difference. I prefer single quote, most of the times. And I highly doubt they affect the script's speed, despite their length.

Share this post

Link to post

Share on other sites

stev379 0

stev379 0

Anytime you are passing a command line paramater you must use double quotes inside single quotes.

i.e. Run('somefile.exe "C:\some folder with spaces\"')

Dos commands will flip out if you pass single quotes.

Also when I see people escaping double quotes instead of using single quotes it hurts my brain.

Straight from the help file:

EVIL!

"here is a ""double-quote"" - ok?"

NOT EVIL!

'here is a "double-quote" - ok?'

WOW! No kidding. I hadn't thought about the cmd line situation. That's easliy half of what I do with scripts. Just to be sure I understand,... single quotes inside single quotes wouldn't work when sending a command?