Jump to content

Check if Variable is blank


Recommended Posts

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

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

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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...