Modify

Opened 17 years ago

Closed 17 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 by J-Paul Mesnage, 17 years ago

no reason that will have avoid the bug ...

comment:2 by J-Paul Mesnage, 17 years ago

Milestone: 3.3.1.2
Resolution: Fixed
Status: newclosed

In fact it is already fix for next beta

Modify Ticket

Action
as closed The owner will remain Gary.

Add Comment


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