home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 February
/
PCWorld_2006-02_cd.bin
/
software
/
vyzkuste
/
triky
/
triky.exe
/
autoit-v3-setup.exe
/
Examples
/
SetError.au3
< prev
next >
Wrap
Text File
|
2004-09-22
|
363b
|
17 lines
$result = myDiv(5, 0)
If @error Then
MsgBox(4096,"Error", "Division by Zero")
Else
MsgBox(4096, "Result", $result)
EndIf
Exit
Func myDiv($dividend, $divisor)
If $dividend = 0 And $divisor = 0 Then
SetError(2) ;indeterminate form 0/0
ElseIf $divisor = 0 Then
SetError(1) ;plain division by zero
EndIf
Return $dividend / $divisor
EndFunc