Jump to content

Escaping the At-Sign


JCrane2
 Share

Recommended Posts

I just upgraded to v3.1.1.71 (beta) to see if this problem was fixed, but it still hasn't been fixed. I want to use

Opt("ExpandVarStrings", 1)
, but when I do, the string "@@" doesn't escape to a single "@", it still evaluates to "@@". If I use a single "@", AutoIt tries to perform a substitution (working as designed). This is a huge bug if you are working with Email addresses.

The following code illustrates this problem:

ConsoleWrite("1. johnrc2@austin.rr.com" & @CRLF)
ConsoleWrite("2. johnrc2@@austin.rr.com" & @CRLF)

Opt("ExpandVarStrings", 1)   ;0=don't expand, 1=do expand
ConsoleWrite("3. johnrc2@austin.rr.com" & @CRLF)
ConsoleWrite("4. johnrc2@@austin.rr.com" & @CRLF)

Opt("ExpandVarStrings", 0)   ;0=don't expand, 1=do expand
ConsoleWrite("5. johnrc2@austin.rr.com" & @CRLF)
ConsoleWrite("6. johnrc2@@austin.rr.com" & @CRLF)

This is what gets written to the console. Unless I am doing something wrong, item #4 is incorrect. It should read: "johnrc2@austin.rr.com. (single "@")

1. johnrc2@austin.rr.com

2. johnrc2@@austin.rr.com

3. johnrc2

4. johnrc2@@austin.rr.com

5. johnrc2@austin.rr.com

6. johnrc2@@austin.rr.com

Link to comment
Share on other sites

1 = expand variables (when in this mode and you want to use a literal $ or @ then double it up: "This is a single dollar $$ sign".

Looks like a bug to me.

This works.

Opt("ExpandVarStrings", 1)
ConsoleWrite("3. johnrc2$austin.rr.com" & @CRLF)
ConsoleWrite("4. johnrc2$$austin.rr.com" & @CRLF)

This does not.

Opt("ExpandVarStrings", 1)
ConsoleWrite("3. johnrc2@austin.rr.com" & @CRLF)
ConsoleWrite("4. johnrc2@@austin.rr.com" & @CRLF)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...