Sign in to follow this  
Followers 0
TK_Incorperate

updating numbers, and checking differences

2 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0