Yashied Posted March 16, 2009 Posted March 16, 2009 It would be good for a better reading of scripts to add to the AutoIt "nil" keyword as in many other programming languages. 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...
Kip Posted March 16, 2009 Posted March 16, 2009 Not the right forum, Null sounds better, and why? 0 does (quite) the same job. Chr(0) returns Null. MailSpons: Fake SMTP server for safe email testing Dutch postcode & address API.
Richard Robertson Posted March 16, 2009 Posted March 16, 2009 The integer value of zero is a fine enough null. That's all null really is anyways. A pointer that points to nothing.
Yashied Posted March 16, 2009 Author Posted March 16, 2009 (edited) "Nil" is not zero, this is zero pointer, so the code is much more logical reading.$Res = DllCall(...)if $Res[0] = nil then...endifI think that it looks more correct than if $Res[0] = 0 then ... In fact present in AutoIt true and false keywords. Edited March 16, 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...
James Posted March 16, 2009 Posted March 16, 2009 It's "null" is it not? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
jvanegmond Posted March 16, 2009 Posted March 16, 2009 Nil could be seen as a substitute for @error and variable declaration. I can't say it helps making programming code more readable or less programs prone to crash. Obviously this is not for AutoIt. I don't think anyone has to mention any reasons. github.com/jvanegmond
GEOSoft Posted March 16, 2009 Posted March 16, 2009 It's "null" is it not?James, what you are thinking of is technically nul not null. Common mistake. Look at Chr(0) in the ascii tableNULL is a macro defined in <stddef.h> for the null pointer. NUL is the name of the first character in the ASCII character set. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
weaponx Posted March 16, 2009 Posted March 16, 2009 Zero and null are two different things. In AutoIt its more common to use "" in place of null.
GEOSoft Posted March 16, 2009 Posted March 16, 2009 Zero and null are two different things. In AutoIt its more common to use "" in place of null.I seem to recall that we just went down this path in another thread.Also, some place in the mix the default keyword comes into play George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
Yashied Posted March 16, 2009 Author Posted March 16, 2009 (edited) Most people in this forum use variables whose names facilitates understanding of the code ($hIcon, $tStruct, $sName, etc.). I propose only to extend this approach. If I write $a = nil, then it clearly indicates that the variable $a is a pointer. Technically, "nil" can equal zero (0). Edited March 16, 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...
trancexx Posted March 16, 2009 Posted March 16, 2009 Nil, nul, null, 0, zero, ... nothing. I really have nothing (null) to do in this parts of the forum, but I know that keyword for null pointer would make some of the udf's to work fully as expected. ... if you do: ..., "str", "something", ... then it's obvious (hey Valik) that if you want to pass null there you have to rewrite the func to be: ..., "ptr", 0, ... or you could pass non-existing keyword null. ♡♡♡ . eMyvnE
GEOSoft Posted March 16, 2009 Posted March 16, 2009 Most people in this forum use variables whose names facilitates understanding of the code ($hIcon, $tStruct, $sName, etc.). I propose only to extend this approach. If I write $a = nil, then it clearly indicates that the variable $a is a pointer. Technically, "nil" can equal zero (0).I think what you are wanting is really a feature request and as such belongs in TRACBe sure to check if it has already been requested and be sure to read the list of things NOT TO ASK FOR. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
jvanegmond Posted March 16, 2009 Posted March 16, 2009 Most people in this forum use variables whose names facilitates understanding of the code ($hIcon, $tStruct, $sName, etc.). I propose only to extend this approach. If I write $a = nil, then it clearly indicates that the variable $a is a pointer. Technically, "nil" can equal zero (0).If you're using nil then you are referring to an invalid or uninitialized variable. Like Ruby or Lua.Not a pointer. github.com/jvanegmond
Richard Robertson Posted March 16, 2009 Posted March 16, 2009 Default is AutoIt's uninitialized variable.
Yashied Posted March 16, 2009 Author Posted March 16, 2009 Default is AutoIt's uninitialized variable. Nil and 0 is technically the same, but logically perceived differently (as 0 and False or 1 and True). 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...
Valik Posted March 16, 2009 Posted March 16, 2009 It's not going to happen. It's not needed. You want it? Guess what:Global Const $Nil = 0No, seriously. You're done.What you are asking for simply does not make sense for this language. Other languages don't use nil, nul, null, none, nothing, et all for only syntax reasons. In most of those languages it implies a lack of object in that it doesn't have a type at all. We don't use that convention in AutoIt. Instead each various hidden type has a default value which means "empty". For pretty much all types it can be compared to 0.
GEOSoft Posted March 16, 2009 Posted March 16, 2009 MJight be one to add to the "Things Not to Ask For" list? Actually I thought it had already been refused at one time but I didn't find it on Trac, probably due to a poor search. I know the discussion has come up a few times. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!"
jvanegmond Posted March 16, 2009 Posted March 16, 2009 Nil and 0 is technically the same, but logically perceived differently (as 0 and False or 1 and True).Not really.nil + 5 = ...Errors out. You can't perform arithmetic on nil values.nil & " some string" = ...Errors out too. You can not perform concatenation on nil values. github.com/jvanegmond
Yashied Posted March 16, 2009 Author Posted March 16, 2009 Not really.nil + 5 = ...Errors out. You can't perform arithmetic on nil values.nil & " some string" = ...Errors out too. You can not perform concatenation on nil values.Nil this is "empty" pointer (0x00000000). Nil + 5 = !!!?????But the next record, I think is logical, but not quite correct in the context of AutoIt.$t = DllStructCreate(...)...$t = Nil 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...
jvanegmond Posted March 16, 2009 Posted March 16, 2009 Nil this is "empty" pointer (0x00000000). Nil + 5 = !!!?????But the next record, I think is logical, but not quite correct in the context of AutoIt.$t = DllStructCreate(...)...$t = NilIf you're using nil then you are referring to an invalid or uninitialized variable. Like Ruby or Lua.Not a pointer. github.com/jvanegmond
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