Modify

Opened 10 years ago

Closed 10 years ago

Last modified 10 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 by Jos, 10 years ago

Owner: set to Jos
Status: newaccepted

comment:2 by Jos, 10 years ago

I will remove the warning for the next release.

Jos

comment:3 by Jos, 10 years ago

Milestone: 3.3.15.1
Resolution: Fixed
Status: acceptedclosed

Fixed by revision [11787] in version: 3.3.15.1

Modify Ticket

Action
as closed The owner will remain Jos.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.