Hi Guys
Im trying to create a Autoit script to install a program for me.
But I seem to have problem:
One of the windows that it need access to auto-click the next button has a " and a | in it. Therefore when I type the statement
WinWaitActive("Atlantis Ocean Mind 1.5")
ControlClick("Atlantis Ocean Mind 1.5","Add to "Start | Programs" menu","TButton2")
and run the sript I get the Error:
ControlClick("Atlantis Ocean Mind 1.5","Add to "Start | Programs" menu","TButton2")
ControlClick("Atlantis Ocean Mind 1.5","Add to ^ ERROR
Erorr: Unable to parse Line.
How to I fix this Error?
Page 1 of 1
AutoIt Problem How do you include " or | in a Statment
#2
Posted 13 September 2005 - 06:31 PM
Look in the Helpfile contents for Language Reference / Datatypes and view the area which references Strings.
Your error has occured because of the double quotes.
Just use single quotes to surround the double quotes or you can double up the double quotes.
Quote
Strings
Strings are enclosed in double-quotes like "this". If you want a string actually contain a double-quote use it twice like:
"here is a ""double-quote"" - ok?"
You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'
You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:
'This "sentence" contains "lots" of "double-quotes" does it not?'
is much simpler than:
"This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"
Strings are enclosed in double-quotes like "this". If you want a string actually contain a double-quote use it twice like:
"here is a ""double-quote"" - ok?"
You can also use single-quotes like 'this' and 'here is a ' 'single-quote' ' - ok?'
You can mix quote types to make for easier working and to avoid having to double-up your quotes to get what you want. For example if you want to use a lot of double-quotes in your strings then you should use single-quotes for declaring them:
'This "sentence" contains "lots" of "double-quotes" does it not?'
is much simpler than:
"This ""sentence"" contains ""lots"" of ""double-quotes"" does it not?"
Your error has occured because of the double quotes.
Quote
ControlClick("Atlantis Ocean Mind 1.5","Add to "Start | Programs" menu","TButton2")
Quote
ControlClick("Atlantis Ocean Mind 1.5",'Add to "Start | Programs" menu',"TButton2")
Share this topic:
Page 1 of 1



Help
Back to top









