Modify

Opened 15 years ago

Closed 15 years ago

#1122 closed Bug (Fixed)

_MathCheckDiv. No error return value.

Reported by: anonymous Owned by: Gary
Milestone: 3.3.1.2 Component: Standard UDFs
Version: 3.3.1.1 Severity: None
Keywords: MathCheckDiv Cc:

Description

Is using SetError(1) after Return. They need to be swapped.

Func _MathCheckDiv($i_NumA, $i_NumB = 2)
	If Number($i_NumA) = 0 Or Number($i_NumB) = 0 Or Int($i_NumA) <> $i_NumA Or Int($i_NumB) <> $i_NumB Then
		Return -1
		SetError(1)
	ElseIf Int($i_NumA / $i_NumB) <> $i_NumA / $i_NumB Then
		Return 1
	Else
		Return 2
	EndIf
EndFunc   ;==>_MathCheckDiv

ps: Any reasons for not using "Return SetError(1,0,-1)"?, apart from "was written before SetError(Er,Ex,Rt) support" of course.
just curious.

Attachments (0)

Change History (2)

comment:1 Changed 15 years ago by Jpm

no reason that will have avoid the bug ...

comment:2 Changed 15 years ago by Jpm

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

In fact it is already fix for next beta

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 Gary.
Author


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

 
Note: See TracTickets for help on using tickets.