Erlend Posted April 12, 2010 Share Posted April 12, 2010 Hello #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") MsgBox(64, "test", "user information is missing") If $getmailNotes = 0 Then Run("..\app1.exe") EndIf how can i get a if statement over to run app1.exe when $getmailnotes returns a blank value. Thanks. Link to comment Share on other sites More sharing options...
99ojo Posted April 12, 2010 Share Posted April 12, 2010 Hi, two ways: #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") ;MsgBox(64, "test", "user information is missing") If $getmailNotes = "" Then Run("..\app1.exe") or #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") If @error Then Run("..\app1.exe") For more information see return values for function _AD_GetObjectAttribute in AD.au3 or in _AD_GetObjectAttribute.htm or .au3 ;-)) Stefan Link to comment Share on other sites More sharing options...
Erlend Posted April 12, 2010 Author Share Posted April 12, 2010 This will give the error: Line-1: Error: Variable must be of type "Object". Link to comment Share on other sites More sharing options...
99ojo Posted April 12, 2010 Share Posted April 12, 2010 Hi, sorry, we forgot at least an _AD_Open () and _AD_Close (): #include <AD.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("TrayIconHide", 1) _ad_open () $getMailNotes = _AD_GetObjectAttribute(@UserName, "notes") ;MsgBox(64, "test", "user information is missing") _ad_close () If $getmailNotes = "" Then Run("..\app1.exe") ;-)) Stefan Link to comment Share on other sites More sharing options...
Erlend Posted April 12, 2010 Author Share Posted April 12, 2010 thanks, i had forgot about that... Link to comment Share on other sites More sharing options...
Spiff59 Posted April 12, 2010 Share Posted April 12, 2010 I'm not familiar with the AD UDF or what can be expected as return values from it's functions, but... I would think you'd want: If $getmailNotes == "" Then Run("..\app1.exe") Unless using the "==" operator, a return of 0 will also equate to an empty string ("") 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