netegg Posted May 4, 2012 Share Posted May 4, 2012 (edited) Today, I encountered a strange problem when i use the select. . .case statement. I really do not understand where there is an error.The following code is simplified, just to describe what the problem is. Select Case ProcessExists('explorer.exe') MsgBox(64, 0, 1) ContinueCase Case ProcessExists('sys.su') ;this is not a real process. but.... MsgBox(64, 0, 2) ContinueCase Case ProcessExists('winlogon.exe') MsgBox(64, 0, 3) EndSelect That's why?Does the ContinueCase cause?Or the condition of 'case 0' is True? But the below is different. Select Case ProcessExists('sys.su') ;this is not a real process. and the msgbox will not show MsgBox(64, 0, 2) ContinueCase Case ProcessExists('explorer.exe') MsgBox(64, 0, 1) ContinueCase Case ProcessExists('winlogon.exe') MsgBox(64, 0, 3) EndSelect Edited May 4, 2012 by netegg Link to comment Share on other sites More sharing options...
stormbreaker Posted May 4, 2012 Share Posted May 4, 2012 Try removing ContinueCase from your script and check if it works ---------------------------------------- :bye: Hey there, was I helpful? ---------------------------------------- My Current OS: Win8 PRO (64-bit); Current AutoIt Version: v3.3.8.1 Link to comment Share on other sites More sharing options...
netegg Posted May 4, 2012 Author Share Posted May 4, 2012 (edited) Try removing ContinueCase from your script and check if it worksRemoving 'continuecase' is not the same as the first code. And, Yes, I know that it can use 'if..then' to do this. I was just puzzled if the sequence causes the difference, and why. Edited May 4, 2012 by netegg Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted May 4, 2012 Share Posted May 4, 2012 From the helpfile:Executing the ContinueCase will tell AutoIt to stop executing the current case and start executing the next case.ContinueCase executes the next case, it does not continue the switch/select or run any conditionals. If you want all cases to run use three separate If's or something to that effect. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
netegg Posted May 4, 2012 Author Share Posted May 4, 2012 (edited) From the helpfile:ContinueCase executes the next case, it does not continue the switch/select or run any conditionals. If you want all cases to run use three separate If's or something to that effect.Thanks, I get it! Edited May 4, 2012 by netegg Link to comment Share on other sites More sharing options...
water Posted May 4, 2012 Share Posted May 4, 2012 There has been a discussion lately in a separate thread (can't find it at the moment) where you'll find an explanation how and why it works the way it does. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki 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