Jump to content
Sign in to follow this  
JohnBailey

Displaying/Passing Returns

Recommended Posts

JohnBailey

How Do I display/obtain a return value from WinWaitClose?

Specifically:

The last function does not execute and I would like to get an error to be displayed via MsgBox().

How do I do this?

#include<.\Include\jClassOpenProgram.au3>
$firstProgram = "Total Service Manager  F:\TSM60\DATA\"
$secondProgram = "Adobe Acrobat Professional - [" & $fileName & "]"
closeProgram($firstProgram)
WinWaitClose("Total Service Manager  F:\TSM60\DATA\",2)
closeProgram($secondProgram)
WinWaitClose("Adobe Acrobat Professional - [" & $fileName & "]")
msgbox(64,"Finished Automation","The automated process is complete. You may now safely use your keyboard and mouse.",10)
Edited by JohnBailey

A decision is a powerful thing

Share this post


Link to post
Share on other sites
_Kurt

Well, to quote the helpfile:

Return Value

Success: Returns 1.

Failure: Returns 0 if timeout occurred.

Returns 0 if bad regexp and @error=1.

Therefore, this SHOULD work:

If NOT WinWaitClose("whatever") = 1 Then Msgbox(0,"","WinWaitClose FAILED")

Kurt

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites
JohnBailey

Well, to quote the helpfile:

Therefore, this SHOULD work:

If NOT WinWaitClose("whatever") = 1 Then Msgbox(0,"","WinWaitClose FAILED")oÝ÷ Ø««·ú®¢×º»p£!iÙè×!Ê.Ü+×¢¶ØZ¶È¦¦·Üéު笶*'v¬¶­æ§Ü(ºW[zX¤y«­¢+Ù]¥¹]¥Ñ
±½Í ÅÕ½ÐíÝ¡ÑÙÉAɽɴÅÕ½Ðì°È¤)%9=P]¥¹]¥Ñ
±½Í ÅÕ½ÐíÝ¡ÑÙÉAɽɴÅÕ½Ðì¤ôÄQ¡¸5ͽà À°ÅÕ½ÐìÅÕ½Ðì°ÅÕ½Ðí]¥¹]¥Ñ
±½Í%1ÅÕ½Ðì

A decision is a powerful thing

Share this post


Link to post
Share on other sites
Jos

Well, to quote the helpfile:

Therefore, this SHOULD work:

If NOT WinWaitClose("whatever") = 1 Then Msgbox(0,"","WinWaitClose FAILED")oÝ÷ Ø««·ú®¢×¥v}ý¶ØZµ·ºÚ"µÍYÕ
Ú[ØZ]ÛÜÙJ  ][ÝÝÚ]]][ÝÊHHJH[ÙØÞ
    ][ÝÉ][ÝË    ][ÝÕÚ[ØZ]ÛÜÙHRSQ ][ÝÊoÝ÷ ÚãºËZºÚ"µÍYÕÚ[ØZ]ÛÜÙJ ][ÝÝÚ]]][ÝÊH[ÙØÞ
    ][ÝÉ][ÝË    ][ÝÕÚ[ØZ]ÛÜÙHRSQ ][ÝÊ

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
Jos

Kurt wow I had no idea I could write it that simply! One question does that mean it would be like

WinWaitClose("whateverProgram",2)
If NOT WinWaitClose("whateverProgram") = 1 Then Msgbox(0,"","WinWaitClose FAILED")

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.