seargent master Posted August 10, 2005 Share Posted August 10, 2005 (edited) i dont know how this can be helpful but..... here it is #include <math.au3> $I_Var = InputBox('Odd or Even', 'Enter a number:') $I_Result = _MathCheckDiv($I_Var, 2) If $I_Result = -1 Or @error = 1 Then MsgBox(0,'','You did not enter a valid number') ElseIf $I_Result = 1 Then MsgBox(0,'','Number is odd') ElseIf $I_Result = 2 Then MsgBox(0,'','Number is even') Else MsgBox(0,'','Could not parse $I_Result') EndIfodd_or_even_real_1.au3 Edited August 10, 2005 by seargent master Link to comment Share on other sites More sharing options...
w0uter Posted August 10, 2005 Share Posted August 10, 2005 try to make it into a func IIRC it has been done before. but dont let that ruin you fun. i made this a long time ago also: Func _IsEven($i_Check) If StringIsDigit($i_Check) Then $i_Check = Number($i_Check) If Not IsNumber($i_Check) Then SetError(1) Return -1 EndIf If Not IsInt($i_Check) Then Return 0 If IsInt($i_Check / 2) Then Return 1 Return 0 EndFunc;==> _IsEven() My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
CyberSlug Posted August 10, 2005 Share Posted August 10, 2005 ;Without any error checking whatsoever Func _IsEven($n) Return Not Mod($n, 2) EndFunc Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
oompah Posted August 10, 2005 Share Posted August 10, 2005 ;Without any error checking whatsoeverFunc _IsEven($n) Return Not Mod($n, 2)EndFunc<{POST_SNAPBACK}>:-) And...Func Even($n)Return Not BitAnd($n, 1)EndFunc 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