Jump to content

Recommended Posts

Posted (edited)

I came across this and i thought this would work, but it didn't =O. :)

Any idea what's wrong

Global $Number=5
If _Mod() Then
    MsgBox(64,"","Success")
Else
    MsgBox(64,"","Failed")
EndIf
Func _Mod()
    Local $Round
    If IsInt(Round($Round=$Number/2)) Then
        Return True
    Else
        Return False
    EndIf
EndFunc

Edit: A simple math question, thanks in advance.

Edited by Generator
Posted

it looks like the math function shouldnt have been in a func:endfunc sorta thing, and the func wasnt on ( _mod() ). not sure if i made sense...lol

Posted

I wonder if you clicked my link ... because that is NOT an UDF but a function already implemented in AutoIt and it does the same thing you're looking for.

I did look at your link but then round wouldn't work. It rounds up not round to decimal.
Posted

I'm confused why would you need Round?

If the result of Mod is 0 then the first number is divisible by the second.

Global $Number=5
If Mod($Number, 2) = 0 Then
    MsgBox(64,"","Success")
Else
    MsgBox(64,"","Failed")
EndIf

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...