Jump to content

updating numbers, and checking differences


Recommended Posts

Ok, well I have a funciton that checks the number of something, and I want to update that, and check for differences in the number, and tell me the difference, but I can't figure it out.... Here's my code

NOTE: This function is done every second, so I don't know how to make the $Stat check differences, but it is set to $Value, then once it is set I need it to check differences, and reset $Stat to the new $Value once it is checked and recorded.

NOTE2: The line "$New = $Value - $Stat" is trying to menis the new value, from the set stat, to see how much of a difference there is.

Func _Update()
    $Value = GetNum()
    $Stat = $Value()
        If $Value <> $Stat Then
            $New = $Value - $Stat
            MsgBox(0, "", "Value changed: " & $New)
        EndIf
EndFunc
Link to comment
Share on other sites

Func _Update()
    If IsDeclared ("Value") = 0 Then Global $Value
    $Stat = $Value
    $Value = GetNum()
        If $Value <> $Stat Then
            $New = $Value - $Stat
            MsgBox(0, "", "Value changed: " & $New)
        EndIf
EndFunc

This should help, if I am right about what you want to do. :)

Edited by BananaFredSoft
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...