Generator Posted August 3, 2007 Share Posted August 3, 2007 (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 August 3, 2007 by Generator Link to comment Share on other sites More sharing options...
JustinReno Posted August 3, 2007 Share Posted August 3, 2007 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 Link to comment Share on other sites More sharing options...
enaiman Posted August 3, 2007 Share Posted August 3, 2007 Are you trying to replicate this? 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 :) Link to comment Share on other sites More sharing options...
Generator Posted August 3, 2007 Author Share Posted August 3, 2007 Well i was looking for if a number is divisible by another number, but now i found the udf and problem solved. Link to comment Share on other sites More sharing options...
enaiman Posted August 3, 2007 Share Posted August 3, 2007 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. 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 :) Link to comment Share on other sites More sharing options...
Generator Posted August 3, 2007 Author Share Posted August 3, 2007 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. Link to comment Share on other sites More sharing options...
enaiman Posted August 3, 2007 Share Posted August 3, 2007 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 :) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now