willwatters Posted May 19, 2005 Share Posted May 19, 2005 Will the following code work - if send and winclose do not work will it send 0 or does this only work for certain commands? $errorcheck = send("Mrs k Good") If ($errorcheck = 0) Then _MyLog($Pre, "20", "Baji", "Data in the Attorney Name field could not be entered", "") EndIf $errorcheck = WinClose("BAJI/CACI Jury Instruction Selector for Windows [instructions Not Saved]") If ($errorcheck = 0) Then _MyLog($Pre, "20", "Baji", "BAJI failed to close", "") EndIf Link to comment Share on other sites More sharing options...
Nutster Posted May 19, 2005 Share Posted May 19, 2005 (edited) Quickly checks the docsHmm, let's see.Send does not return a value. Check @Error instead.Neither does WinClose. Check @Error for information.Check the documentation for each of these functions for more information.Edit: Fxi Spelling errors. Edited May 19, 2005 by Nutster David NuttallNuttall Computer Consulting An Aquarius born during the Age of Aquarius AutoIt allows me to re-invent the wheel so much faster. I'm off to write a wizard, a wonderful wizard of odd... Link to comment Share on other sites More sharing options...
willwatters Posted May 20, 2005 Author Share Posted May 20, 2005 Quickly checks the docsHmm, let's see.Send does not return a value. Check @Error instead.Neither does WinClose. Check @Error for information.Check the documentation for each of these functions for more information.Edit: Fxi Spelling errors.<{POST_SNAPBACK}>I looked at @error and i don't understand - how can I apply it to check if a window closed successfully and if something was sent successfully?I would really apprecaite your help. Link to comment Share on other sites More sharing options...
/dev/null Posted May 20, 2005 Share Posted May 20, 2005 Will the following code work - if send and winclose do not work will it send 0 or does this only work for certain commands?according to the docs....send does not have a return value and does not set @error, so you cannot sayif send did work or not. Actually, send will always work, as you can always send a message. You just don't know if somebody received it.....winclose will return either 0 ("cannot find window title) or 1 ("sucess"). Check the return code like this: $err = winclose("window xyz").However, winclose will only send a "CLOSE" message to the windows. This does not necessarily close the window, as it might for example ask the user to save some data. To kill a window use WinKill()CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
willwatters Posted May 23, 2005 Author Share Posted May 23, 2005 according to the docs....send does not have a return value and does not set @error, so you cannot sayif send did work or not. Actually, send will always work, as you can always send a message. You just don't know if somebody received it.....winclose will return either 0 ("cannot find window title) or 1 ("sucess"). Check the return code like this: $err = winclose("window xyz").However, winclose will only send a "CLOSE" message to the windows. This does not necessarily close the window, as it might for example ask the user to save some data. To kill a window use WinKill()CheersKurt<{POST_SNAPBACK}>I ran the following code:$err = winclose("window xyz")MsgBox(4096,"Test", $err)and it gave an exit code of 1 even though the window xyz does not exist. should it have not returned 0 or does it only return 0 if a valid window cannot close? Link to comment Share on other sites More sharing options...
GaryFrost Posted May 23, 2005 Share Posted May 23, 2005 (edited) From help file on WinClose from release versionReturn ValueNone.from beta helpReturn ValueSuccess: Returns 1. Failure: Returns 0 if window is not found. Edited May 23, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
willwatters Posted May 23, 2005 Author Share Posted May 23, 2005 From help file on WinClose from release versionfrom beta help<{POST_SNAPBACK}>So you are saying that winclose will not return 0 for a failure and 1 for success? 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