sunny Posted May 4, 2009 Share Posted May 4, 2009 Friends, Some of my queries are returning null values How can i check whether it is null or not? Is there any keyword called NULL so that i can compare my value with that keyword to determine whether its null or not Regards Link to comment Share on other sites More sharing options...
Qousio Posted May 4, 2009 Share Posted May 4, 2009 Friends, Some of my queries are returning null values How can i check whether it is null or not? Is there any keyword called NULL so that i can compare my value with that keyword to determine whether its null or not Regards $Var = 0 MsgBox( 0, "Its null!", $Var) ;or If $Var = 0 Then MsgBox( 0, "Its null!", $Var) EndIf Link to comment Share on other sites More sharing options...
Bowmore Posted May 4, 2009 Share Posted May 4, 2009 AutoIt has no NULL keyword. One method I have used is: If StringLen($value) = 0 Then MsgBox( 0, "$value = ", "Null") Else MsgBox( 0, "$value = ", $value) EndIf which works for both string and numeric fields "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook Link to comment Share on other sites More sharing options...
Yashied Posted May 5, 2009 Share Posted May 5, 2009 In some cases, you should use IsPtr(0). I also asked this question. See this. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
trancexx Posted May 5, 2009 Share Posted May 5, 2009 In some cases, you should use IsPtr(0). I also asked this question. See this.What cases for example? ...anyway, if you need to check if something is not nothing then you would probably do it like this: $iValue = 0 If $iValue Then ;... Else ConsoleWrite("! iValue in not" & @CRLF) EndIf $sValue = "" If $sValue Then ;... Else ConsoleWrite("! sValue in not" & @CRLF) EndIf $fValue = False If $fValue Then ;... Else ConsoleWrite("! fValue in not" & @CRLF) EndIf Or maybe: If Not $iValue ... ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
Kip Posted May 5, 2009 Share Posted May 5, 2009 $Var = 0MsgBox( 0, "Its null!", $Var);orIf $Var = 0 Then MsgBox( 0, "Its null!", $Var) EndIf0 is not NULL. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API. Link to comment Share on other sites More sharing options...
Bert Posted May 5, 2009 Share Posted May 5, 2009 $value ="" The Vollatran project  My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Yashied Posted May 6, 2009 Share Posted May 6, 2009 (edited) What cases for example?$Ret = DllCall(...) if $Ret[0] = Ptr(0) then ... endif Edited May 6, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Juvigy Posted May 6, 2009 Share Posted May 6, 2009 Maybe it is a good idea to add another UDF in the SQL UDF's that checks for "NULL" values or just modify the query functions to indicate when they return "NULL" ? 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