My stupid question

Discuss the future of the AutoHotkey language
User avatar
oldbrother
Posts: 273
Joined: 23 Oct 2013, 05:08

My stupid question

02 Aug 2021, 14:26

I read the V2 documentation and come with a stupid question:

Why IniRead has been changed to:

Code: Select all

Value := IniRead(Filename, Section, Key , Default)
Section := IniRead(Filename, Section)
SectionNames := IniRead(Filename)
But IniDelete and IniWrite are still not functions:

Code: Select all

IniDelete Filename, Section , [Key]

IniWrite Value, Filename, Section, Key
IniWrite Pairs, Filename, Section
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: My stupid question

02 Aug 2021, 14:42

it would make no sense to statement-call IniRead()(although u are free to do so, if u so desire)

Code: Select all

IniRead Filename, Section, Key [, Default]
IniRead Filename, Section
IniRead Filename
IniRead() has no (immediate, that u would typically care about) sideeffects and ure calling it for its return value
IniDelete() has sideeffects and no return value, so statement-calling it can make sense, so the docs depict that usage(i think this holds for all such uses but i havent gone through the entire docs in a while)
oldbrother wrote:
02 Aug 2021, 14:26
are still not functions
everything is a function. and everything under the right(wrong?) circumstances can be a Function Call Statement(although id very much like for that to not have been the case, lexikos, please delete this feature already lol)
User avatar
oldbrother
Posts: 273
Joined: 23 Oct 2013, 05:08

Re: My stupid question

03 Aug 2021, 16:16

I understand now:

All functions can be called without parentheses if the return value is not needed (but as before, parentheses cannot be omitted for calls within an expression).

Sorry I'm too old to catch all the details. :facepalm:

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 86 guests