Jump to content
Sign in to follow this  
Erlend

Check if Variable is blank

Recommended Posts

Erlend

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.

Share this post


Link to post
Share on other sites
99ojo

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

Share this post


Link to post
Share on other sites
Erlend

This will give the error:

Line-1:

Error: Variable must be of type "Object".

Share this post


Link to post
Share on other sites
99ojo

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

Share this post


Link to post
Share on other sites
Spiff59

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 ("")

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.