Command parameters must be simple / regular

Share your ideas as to how the documentation can be improved.
User avatar
mslonik
Posts: 144
Joined: 21 Feb 2019, 04:38
Location: Poland
Contact:

Command parameters must be simple / regular

11 Apr 2021, 03:39

Dear Forum,

I've found that for commands (e.g. IniRead) the OutputVar parameter must be simple / regular. It means that as OutputVar I must not use object types (e.g. linear array or associative array etc.). This issue was discussed in this topic. This isn't true for functions. So I see here advantage / disadvantage if commands are compared to functions.

My suggestions to documentation:

General:
Mention about this trait when difference between functions and commands are described: here and here.

Specific:
Mention about this trait in each specific command description, in OutputVar section, e.g. in description of IniRead command.

Kind regards, mslonik

My scripts on this forum: Hotstrings Diacritic O T A G L E
Please become my patreon: Patreon👍
Written in AutoHotkey text replacement tool: Hotstrings.technology
Courses on AutoHotkey :ugeek:
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Command parameters must be simple / regular

11 Apr 2021, 03:50

jftr, currently, there is a (short) mention here - re "forcing an expression":
https://www.autohotkey.com/docs/Variables.htm#Expressions wrote:Force an expression: An expression can be used in a parameter that does not directly support it (except OutputVar parameters) by preceding the expression with a percent sign and a space or tab. In [v1.1.21+], this prefix can be used in the InputVar parameters of all commands except the traditional IF commands (use If (expression) instead). This technique is often used to access arrays.
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Command parameters must be simple / regular

11 Apr 2021, 03:56

Also, the second place you suggested for an addendum already contains this information - even in a special 'note' box:
https://www.autohotkey.com/docs/Language.htm#outputvar-and-inputvar-parameters wrote:Note: Only a plain variable can be used as an OutputVar. Array elements, properties and other expressions are not supported.
User avatar
mslonik
Posts: 144
Joined: 21 Feb 2019, 04:38
Location: Poland
Contact:

Re: Command parameters must be simple / regular

11 Apr 2021, 10:15

Yes, you're right. True, it's mentioned. Then I suggest to close this topic.

Kind regards, mslonik

My scripts on this forum: Hotstrings Diacritic O T A G L E
Please become my patreon: Patreon👍
Written in AutoHotkey text replacement tool: Hotstrings.technology
Courses on AutoHotkey :ugeek:

Return to “Suggestions on Documentation Improvements”

Who is online

Users browsing this forum: No registered users and 17 guests