Opened 3 years ago

Closed 3 years ago

#3773 closed Bug (No Bug)

Return value in SetError() is limited to 32-bit valuies

Reported by: jchd18 Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description (last modified by jchd18)

It isn't possible to set a 64-bit return value using SetError() in either X86 or X64 modes. It's even impossible to set a X64 pointer as return value using SetError().

OTOH Return allows 64-bit values regardless of mode.

Local $n = 0x0123456789abcdef, $r
ConsoleWrite("Passed value:" & @TAB & $n & @LF)
$r = MyRetFunc($n)
ConsoleWrite(@error & @TAB & @extended & @TAB & MyRetFunc($n) & @LF)
$r = MyErrFunc($n)
ConsoleWrite(@error & @TAB & @extended & @TAB & MyErrFunc($n) & @LF)

Func MyErrFunc($v)
	SetError(1, 2, $v)

Func MyRetFunc($v)
	SetError(1, 2)
	Return $v

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by jchd18

  • Description modified (diff)

comment:2 Changed 3 years ago by Jpm

  • Resolution set to No Bug
  • Status changed from new to closed

there is no real error. if you want the value to be return you need to explicitly return it

Func MyErrFunc($v)
	Return SetError(1, 2, $v)


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.