Sign in to follow this  
Followers 0
Bokkie

Is there a macro for quoting?

11 posts in this topic

There are macros for $TAB, $LF and others but is there a builtin macro for the double-quote character? I can use Chr(34) with no problem, but using something like $QUOTE would be more intuitive perhaps.

Share this post


Link to post
Share on other sites



Errr ... That really makes no sense, or maybe I'm just not understanding it...


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

There are macros for $TAB, $LF and others but is there a builtin macro for the double-quote character? I can use Chr(34) with no problem, but using something like $QUOTE would be more intuitive perhaps.

"this is a quote: ""."

'this is a quote: ".'

why would you need another way ?


My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Share this post


Link to post
Share on other sites

Errr ... That really makes no sense, or maybe I'm just not understanding it...

For example, I want to quote a string for display purposes.

Something like Chr(34) & "C:\Temp" & Chr(34)

would display "C:\Temp" as opposed to the unquoted display C:\Temp.

Share this post


Link to post
Share on other sites

For example, I want to quote a string for display purposes.

Something like Chr(34) & "C:\Temp" & Chr(34)

would display "C:\Temp" as opposed to the unquoted display C:\Temp.

Why not just type out "C:\Temp"? Less effort for sure...

And if your in a situation where you have to use something to create the quote... Chr(34) is just as easy as @Quote. I have run into situations where I have to do multiple Chr() rather than the string itself... but doesn't take any time... or do you just like the idea that you can type @Q and the option for @Quote would pop up in SciTe?


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Why not just type out "C:\Temp"? Less effort for sure...

And if your in a situation where you have to use something to create the quote... Chr(34) is just as easy as @Quote. I have run into situations where I have to do multiple Chr() rather than the string itself... but doesn't take any time... or do you just like the idea that you can type @Q and the option for @Quote would pop up in SciTe?

I agree there are many stylistic preferences but """ is not so agreeable to the eye especially when printed. To me @QUOTE is easier to understand to some extent. @TAB is better than Chr(9) etc. :o

Share this post


Link to post
Share on other sites

I agree there are many stylistic preferences but """ is not so agreeable to the eye especially when printed. To me @QUOTE is easier to understand to some extent. @TAB is better than Chr(9) etc. :o

Seems more of a Chat topic, It's an opinion at best.

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

I understand. I've sometimes wanted a macro for space!

I wonder if the main devs would go for someting like:

@SP - space

@SQ - single quote mark (apostrophe)

@DQ - double quote mark

Quotes might not be needed here, but I consider the first line the most readable....

$path = "C:\some long path\with spaces.txt"
Run("notepad.exe" & @SP & @DQ & $path & @DQ)

;versus
Run("notepad.exe " & """" $path & """")
;or
Run('notepad.exe "' & $path & '"')
;etc

Another example:

$exe = "C:\some buried executable\foo bar.exe"
$file = "C:\some long path\with spaces.txt"
Run($exe & @SP & @DQ & $file & @DQ)

;versus
Run($exe & " " & """" $file & """")
;or
Run($exe & ' "' $file & '"')
;etc
Edited by CyberSlug

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

I understand. I've sometimes wanted a macro for space!

I wonder if the main devs would go for someting like:

@SP - space

@SQ - single quote mark (apostrophe)

@DQ - double quote mark

Quotes might not be needed here, but I consider the first line the most readable....

$path = "C:\some long path\with spaces.txt"
Run("notepad.exe" & @SP & @DQ & $path & @DQ)

;versus
Run("notepad.exe " & """" $path & """")
;or
Run('notepad.exe "' & $path & '"')
;etc

Another example:

$exe = "C:\some buried executable\foo bar.exe"
$file = "C:\some long path\with spaces.txt"
Run($exe & @SP & @DQ & $file & @DQ)

;versus
Run($exe & " " & """" $file & """")
;or
Run($exe & ' "' $file & '"')
;etc
Ahh, now that example makes sense.. but not using it to go like $Path = @DQ & C:\Something & @DQ Edited by SmOke_N

[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

Share this post


Link to post
Share on other sites

Ahh, now that example makes sense.. but not using it to go like $Path = @DQ & C:\Something & @DQ

Why not, pray tell!

@DQ "Seems more of a Chat topic, It's an opinion at best." @DQ

:o

Share this post


Link to post
Share on other sites

Why not, pray tell!

@DQ "Seems more of a Chat topic, It's an opinion at best." @DQ

:o

It's still an opnion at best...

You stated @Tab is better than Chr(9). That's a personal preference... therefore an opinion at best.

CyberSlug provided a reasonable explination on why this would be useful, and I provided why your example would not have been.


[center]Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.[/center]

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