Jump to content

Get the rest from a Step Counter


_Vlad
 Share

Recommended Posts

Hello,

I have this script :

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 224, 93, -1, -1)
$Input1 = GUICtrlCreateInput("", 16, 16, 121, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Button1 = GUICtrlCreateButton("test", 16, 48, 75, 25)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Button1
            _Calculate()

    EndSwitch
WEnd

Func _Calculate()

    $last = 0
    $open = 0
    For $i = 1 To GUICtrlRead($Input1) Step 50
        $open += 1
    Next
    $last = 50 * $open
    MsgBox(0,'', $open & @CRLF & $last)

EndFunc

Basically this script tells me how many times can fit 50 in a number.

What i search for is that if I have a number like (103), to count 2 times 50 and tell me that 3 is the difference.

How can I do that?
Many thanks!  

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...