BASIC Boolean help

Messages
8,474
Location
Australia

If total.Value = 1073741824 Then tb.Text = "test"


What i want this to do,is when TOTAL reaches 1073741824 it will change the text in the text box,Why isnt this working? it will run no problem it just wont change the text box.
 
do you have it in a looping structure and incremented??

what language are you doing this in a maybe a little more of the program so that I can see what your trying to do. It's not working because the if statement never sees that value.
 
HAve you tried 1073741824 in quotes, otherwise it could be looking for 1073741824 as a variable

If total.Value = "1073741824" Then tb.Text = "test"

And I assume this is with a loop that is incremeting total somehow untill it will reach the desired number?
 
Nope,that didnt work neither,I think you might be rigt there,although i have it running here:

PrivateSub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
total.Value = bytes.RawValue
TextBox1.Text = bytes.RawValue
If total.Value = 1073741824 Then
tb.Text = "test"
EndIf

EndSub

So every ten miliseconds its checking the value,so maybe i am running it in a loop? Im still a newb at visual basic.
 
Nope,that didnt work neither,I think you might be rigt there,although i have it running here:



So every ten miliseconds its checking the value,so maybe i am running it in a loop? Im still a newb at visual basic.

Is that all of your code? where is the function being called from?
 
Here is the full script.
ublic Class form

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

total.Value = 1073741824
End Sub



Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
total.Value = bytes.RawValue
TextBox1.Text = bytes.RawValue

If total.Value >= 1073741824 Then
tb.Text = "test"
End If


End Sub
End Class
 
Back
Top Bottom