Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#2634 closed Feature Request (Fixed)

Treat keyword Default like an unset optional parameter

Reported by: water Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Default optional parameter Cc:


When keyword Default is passed to a function for an optional parameter it should be replaced by the default value for this parameter.
This would save a lot of statements in many UDFs to set the value of a parameter to the default value as defined in the Func statement for optional parameters.

Example: The MsgBox should always display 1 for P1 even when passed as keyword Default.

Func _Test($P1 = 1, $P2 = 2)
	MsgBox(0, "Parameters", "P1: " & $P1 & @CRLF & "P2: " & $P2)

Has been discussed here:

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by mLipok

is it completed now ?

Func _Test($P1 = 1, $P2 = 2)
	MsgBox(0, "Parameters", "P1: " & $P1 & @CRLF & VarGetType($P1) &@CRLF & "P2: " & $P2)

comment:2 Changed 9 years ago by Jpm

  • Resolution set to Fixed
  • Status changed from new to closed

I agree, I can't remember when ...

comment:3 Changed 9 years ago by mLipok

Please consider if this change do not need some more description in HelpFile

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The ticket will remain with no owner.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.