Jump to content

Modulo of a great Number How to


Recommended Posts

Hi!

AutoIt doesn't support that big of a number (I don't think any language does that natively, that number is huuuuuge).

I came up with a solution though :)

MsgBox(0, "", _GreatMod("5117523067010037908340055150701","97"))
Func _GreatMod($num1, $num2)
    RegWrite("HKCU\Software\Microsoft\Calc","layout","REG_DWORD",0); So that calc.exe will have the right layut
    Opt("SendKeyDelay", 0)
    Opt("SendKeyDownDelay", 1)
    $fpid = Run("calc.exe", @SystemDir, @SW_HIDE); Doesn't hide the calculator for some unknown reason(!)
    WinWait("[CLASS:SciCalc]")
    ControlSend("[CLASS:SciCalc]", "", 403, $num1)
    Sleep(25 * StringLen($num1) + 20)
    ControlClick("[CLASS:SciCalc]", "", 94)
    ControlSend("[CLASS:SciCalc]", "", 403, $num2)
    Sleep(25 * StringLen($num2) + 20)
    ControlClick("[CLASS:SciCalc]", "", 112)
    $return = StringTrimRight(ControlGetText("[CLASS:SciCalc]", "", 403), 2)
    ProcessClose($fpid)
    Return $return
EndFunc  ;==>_GreatMod

:P

Broken link? PM me and I'll send you the file!

Link to comment
Share on other sites

Hi!

AutoIt doesn't support that big of a number (I don't think any language does that natively, that number is huuuuuge).

I came up with a solution though :)

MsgBox(0, "", _GreatMod("5117523067010037908340055150701","97"))
Func _GreatMod($num1, $num2)
    RegWrite("HKCU\Software\Microsoft\Calc","layout","REG_DWORD",0); So that calc.exe will have the right layut
    Opt("SendKeyDelay", 0)
    Opt("SendKeyDownDelay", 1)
    $fpid = Run("calc.exe", @SystemDir, @SW_HIDE); Doesn't hide the calculator for some unknown reason(!)
    WinWait("[CLASS:SciCalc]")
    ControlSend("[CLASS:SciCalc]", "", 403, $num1)
    Sleep(25 * StringLen($num1) + 20)
    ControlClick("[CLASS:SciCalc]", "", 94)
    ControlSend("[CLASS:SciCalc]", "", 403, $num2)
    Sleep(25 * StringLen($num2) + 20)
    ControlClick("[CLASS:SciCalc]", "", 112)
    $return = StringTrimRight(ControlGetText("[CLASS:SciCalc]", "", 403), 2)
    ProcessClose($fpid)
    Return $return
EndFunc ;==>_GreatMod

:P

Thanks for this formula doesn't works on French system
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...