Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3267 closed Bug (Fixed)

ByRef parameter with unnamed temporary variables

Reported by: binu Owned by: Jos
Milestone: 3.3.15.1 Component: Au3Check
Version: 3.3.14.2 Severity: None
Keywords: ByRef, parameter, unnamed temporary, variables Cc:

Description

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
;#AutoIt3Wrapper_Run_AU3Check=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****

main()
Func main()
	$var = "asdf"
	ExampleOne($var)
	ExampleTwo($var)
	ConsoleWrite(">" & @CR)

	$var = "asdf"
	$var = ExampleOne($var)
	ExampleTwo($var)

	ConsoleWrite(">" & @CR)

	$var = "asdf"
	ExampleTwo(ExampleOne($var))
EndFunc   ;==>main

Func ExampleOne(ByRef $var)
	ConsoleWrite($var & " > ExampleOne" & @CR)
	Return $var & " > ExampleOne"
EndFunc   ;==>ExampleOne

Func ExampleTwo(ByRef $var)
	ConsoleWrite($var & " > ExampleTwo" & @CR)
	Return $var & " > ExampleTwo"
EndFunc   ;==>ExampleTwo

From the AutoIt Help:
Note that not only a named variable can be passed for a ByRef parameter - unnamed temporary variables, such as function return values, may be passed as ByRef parameters as well.

Attachments (0)

Change History (4)

comment:1 Changed 8 years ago by Jos

  • Owner set to Jos
  • Status changed from new to accepted

comment:2 Changed 8 years ago by Jos

I will remove the warning for the next release.

Jos

comment:3 Changed 8 years ago by Jos

  • Milestone set to 3.3.15.1
  • Resolution set to Fixed
  • Status changed from accepted to closed

Fixed by revision [11787] in version: 3.3.15.1

comment:4 Changed 8 years ago by anonymous

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

Action
as closed The owner will remain Jos.
Author


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

 
Note: See TracTickets for help on using tickets.