Sign in to follow this  
Followers 0
PC.MAX

' And "

4 posts in this topic

what is the difference between ' ' and " " ?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi,

maybe this helps.

2.3.2 Strings
Because a string’s value can be virtually anything, AutoIt needs to be told where strings start
and end. This is done by placing a single quote (') or double quote (") at both ends of the
string. (You may have noticed that the script from the tutorial uses double quotes.)
When a string doesn’t contain either type of quote, whichever one you choose to surround
the string makes no difference (personally I prefer the tidier-looking single quotes). If a string
should contain one type of quote but not the other then it makes sense to use that other type
of quote to surround the string.
What happens though if the string should contain both types of quote? In such a case
you must nominate which quote you will use to surround the string, and then double up on
any occurrences of that quote within the string. Here’s an example of a string containing
both types of quote:
I'm a string with single and "double" quotes.
If we wanted to surround the string with double quotes then we would double up on the
double quotes within the string, giving us this:
"I'm a string with single and ""double"" quotes."
If we wanted to instead use single quotes then we would double up on the single quote and
this would be the result:
'I''m a string with single and "double" quotes.'

Copied out of a help tutorial.

Link http://www.autoitscript.com/forum/index.ph...ic=19434&hl=Lxp

So long,

Mega

Edited by th.meger

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

what is the difference between ' ' and " " ?

If you put a space between the single or double quotes, nothing.

This is what makes AutoIT so flexible in that you can intermix these in your code, making for some powerful expressions, particularly when you pass parameters to functions and external programs that expect one or the other type of quote - you can use the other to surround the portion to pass as a parameter and then embed the other type within the parameter. DOS calls is a prime example where a good understanding of this concept can make a difference between a mess and a good subroutine. Just make sure you keep them in matched pairs, eh!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0