Sign in to follow this  
Followers 0
Zopieux

What is the best : " or ' ?

7 posts in this topic

Hi again,

I wonder what is the best way to declare strings : do I have to use double quotes "foo" or single quotes 'foo' ?

I ask this question because in the PHP language, it is better to use single quotes, and it could be different with AutoIt...

Best regards,

Zopieux :)


I'm not English, then please excuse my spelling :)

Share this post


Link to post
Share on other sites

The help file gives a good explanation of this under Datatypes.

Share this post


Link to post
Share on other sites

OK, thanks for the tips, I didn't see the "datatypes" chapter.


I'm not English, then please excuse my spelling :)

Share this post


Link to post
Share on other sites

OK, thanks for the tips, I didn't see the "datatypes" chapter.

You can find it two different ways:
  • Under the index as "Datatypes"
  • Under Contents -->AutoIt -->Language Reference -->Datatypes

Share this post


Link to post
Share on other sites

I personally have a problem with single quotation since I often confuse them for apostrophe.

Example:

$var = 'The ball is not mine, it is Jona's

Although this doesn't happen to me all the time, I'd use double quotation just to be on the safe side, since after coding hundred of lines, it's hard to find that kind of mistake.


[font="Georgia"]Chances are, I'm wrong.[/font]HotKey trouble?Stringregexp GuideAutoIT Current Version

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