fchelp Posted February 13, 2018 Share Posted February 13, 2018 (edited) Hi, I'm trying to get the value of WinTitleMatchMode so i checked the help file, and it says "If the param is not provided, then the function just returns the value already assigned to the option." So i'm running this line in SciTE AutoItSetOption( "WinTitleMatchMode" ) And am checking the output, but the only output i'm getting is Quote +>13:15:42 AutoIt3.exe ended.rc:0 +>13:15:42 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.9874 What am i doing wrong? I'm trying to set it that it should do exact match on titles, but i want to see first what is the current setting. Thanks in advance! Edited February 13, 2018 by fchelp Link to comment Share on other sites More sharing options...
Developers Jos Posted February 13, 2018 Developers Share Posted February 13, 2018 2 minutes ago, fchelp said: What am i doing wrong? What were you expecting as that statement will return the current value but you aren't doing anything with it. In case you were expecting a Console message you need to tell the script to do so like: ConsoleWrite('AutoItSetOption( "WinTitleMatchMode" ) = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF ) Jos fchelp 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
fchelp Posted February 13, 2018 Author Share Posted February 13, 2018 2 minutes ago, Jos said: What were you expecting as that statement will return the current value but you aren't doing anything with it. In case you were expecting a Console message you need to tell the script to do so like: ConsoleWrite('AutoItSetOption( "WinTitleMatchMode" ) = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF ) Jos Thanks! But could you please explain the code you wrote? i'm trying to learn, and i'm wondering why doesn't this work? (i tested it) ConsoleWrite('AutoItSetOption( "WinTitleMatchMode" )' & @CRLF ) Link to comment Share on other sites More sharing options...
Developers Jos Posted February 13, 2018 Developers Share Posted February 13, 2018 Because you are telling AutoIt3 to write that exact literal string: 'AutoItSetOption( "WinTitleMatchMode" )' ... not to perform the function. Just try understanding the scriptline I wrote. Jos fchelp 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
fchelp Posted February 13, 2018 Author Share Posted February 13, 2018 (edited) 9 minutes ago, Jos said: Because you are telling AutoIt3 to write that exact literal string: 'AutoItSetOption( "WinTitleMatchMode" )' ... not to perform the function. Just try understanding the scriptline I wrote. Jos Got you halfway. I was able to get the data like this $ttest = AutoItSetOption( "WinTitleMatchMode" ) ConsoleWrite($ttest & @CRLF ) But i still don't understand how your script line works. Is there a help file i could read that explains how to output the result of a commend in Consolewrite without setting it first as a variable? (as it seems this is what you did, i just don't understand how it works) NVM disregard that, i figured that out, it's ConsoleWrite( AutoItSetOption( "WinTitleMatchMode" ) & @CRLF ) Now why did you need to make that long line of code? Thanks so much for your patience! Edited February 13, 2018 by fchelp Link to comment Share on other sites More sharing options...
Developers Jos Posted February 13, 2018 Developers Share Posted February 13, 2018 ConsoleWrite('this part is just text also called literal string = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF ) So that line simply concatenates a String with the result of the function: AutoItSetOption( "WinTitleMatchMode" ) and concatenates a CRLF at the end. Jos fchelp 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
fchelp Posted February 13, 2018 Author Share Posted February 13, 2018 4 minutes ago, Jos said: ConsoleWrite('this part is just text also called literal string = ' & AutoItSetOption( "WinTitleMatchMode" ) & @CRLF ) So that line simply concatenates a String with the result of the function: AutoItSetOption( "WinTitleMatchMode" ) and concatenates a CRLF at the end. Jos Thanks! i got it in the same second you wrote it Link to comment Share on other sites More sharing options...
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