Bokkie Posted March 7, 2006 Posted March 7, 2006 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.
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 Errr ... That really makes no sense, or maybe I'm just not understanding it... 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.
w0uter Posted March 7, 2006 Posted March 7, 2006 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
Bokkie Posted March 7, 2006 Author Posted March 7, 2006 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.
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 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? 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.
Bokkie Posted March 7, 2006 Author Posted March 7, 2006 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.
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 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. Seems more of a Chat topic, It's an opinion at best. 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.
CyberSlug Posted March 7, 2006 Posted March 7, 2006 (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 March 7, 2006 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!
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 (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 & '"') ;etcAhh, now that example makes sense.. but not using it to go like $Path = @DQ & C:\Something & @DQ Edited March 7, 2006 by SmOke_N 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.
Bokkie Posted March 7, 2006 Author Posted March 7, 2006 Ahh, now that example makes sense.. but not using it to go like $Path = @DQ & C:\Something & @DQWhy not, pray tell!@DQ "Seems more of a Chat topic, It's an opinion at best." @DQ
Moderators SmOke_N Posted March 7, 2006 Moderators Posted March 7, 2006 Why not, pray tell!@DQ "Seems more of a Chat topic, It's an opinion at best." @DQIt'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. 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now