[Help]Subtracting from a Range[/Solved]

Posts 1–15 of 34 · Page 1 of 3
[Help]Subtracting from a Range[/Solved]
Ive been working on this for awhile and still can't figure something out.

So, what i'm trying to do is subtract 100 from 100+, but i can't get it to stop if it's under 100...

Heres a few things that i tried...

Code:
If Form2.money.Text = 100 Or +100 Then
            Form2.money.Text -= 100
        ElseIf Form2.money.Text = 99 Or -99 Then
            MsgBox("You do not have enough money.", MsgBoxStyle.Information)
        End If
Code:
        If Form2.money.Text = +100 Then
            Form2.money.Text -= 100
        ElseIf Form2.money.Text = -100 Then
            MsgBox("You do not have enough money.", MsgBoxStyle.Information)
        End If
Yes, 'money' is a label.
Quote Originally Posted by Cryptonic View Post
Ive been working on this for awhile and still can't figure something out.

So, what i'm trying to do is subtract 100 from 100+, but i can't get it to stop if it's under 100...

Heres a few things that i tried...

Code:
If Form2.money.Text = 100 Or +100 Then
            Form2.money.Text -= 100
        ElseIf Form2.money.Text = 99 Or -99 Then
            MsgBox("You do not have enough money.", MsgBoxStyle.Information)
        End If
Code:
        If Form2.money.Text = +100 Then
            Form2.money.Text -= 100
        ElseIf Form2.money.Text = -100 Then
            MsgBox("You do not have enough money.", MsgBoxStyle.Information)
        End If
Yes, 'money' is a label.
Maybe this ?
Code:
If Form2.money.Text >= 100 Then
            Form2.money.Text -= 100
        ElseIf Form2.money.Text <= 99 Then
            MsgBox("You do not have enough money.", MsgBoxStyle.Information)
        End If
Code:
        If Form2.money.Text >= 100 Then
            Form2.money.Text -= 100
        ElseIf Form2.money.Text <= 100 Then
            MsgBox("You do not have enough money.", MsgBoxStyle.Information)
        End If
I didn understand what you want, But maybe is that :S
Quote Originally Posted by Lyoto Machida View Post
If Form2.money.Text >= 100 Then
Form2.money.Text -= 100
ElseIf Form2.money.Text <= 99 Then
MsgBox("You do not have enough money.", MsgBoxStyle.Information)
End If
Yes, thats exactly what i wanted, i didnt think to use < and >...

and

i have another question.

For example:

you have 2 buttons, one is enabled, and one isnt. You have a timer that disables both buttons and re-enables the 1 that is enabled to begin with.

then, the second button is enabled, (now there both enabled), now, how would the timer start to enable the second button.

if its confusing, just ask and ill post a different example.
Its confusing + My Fukin English = WHAT FUK?

But you tryin this?

Timer1
Code:
Button1.Enabled = False
Button2.Enabled = False
Button1.Enabled = True
Button2.Enabled = True
Lol I dont understand you , But that code Disable both button then enabled again..
Yea, i though that would be confsusing. Heres a better example:

Button1 = Job 1
Button2 = Job 2

You can only do Job one now (meaning button 2 is disabled) and you must have 10 energy to do so. Now, you have 0 Energy and your waiting to restore more, and at that time job 1 is disabled to use. Then you level up and you unlock job 2. You get your energy restored and now you use all your energy. Now job 1 and 2 are disabled. You wait and recover your health, now job 1 & 2 are enabled

like mifia wars...
Its hard to understand but maybe something like this:

Button1 :
Code:
If Button2.Enabled = False Then

' Job



End if

Button2:

Code:
If Button1.Enabled = False Then

' Job


End if

or This:

Button2:

Code:
If Energy.Text = "10" Then

' Job

Else
Msgbox("Wait to restore your energy")


End if
Is something like that xD
Quote Originally Posted by Lyoto Machida View Post
Its hard to understand but maybe something like this:

Button1 :
Code:
If Button2.Enabled = False Then

' Job



End if

Button2:

Code:
If Button1.Enabled = False Then

' Job


End if

or This:

Button2:

Code:
If Energy.Text = "10" Then

' Job

Else
Msgbox("Wait to restore your energy")


End if
Is something like that xD
Ehh, not really, uhm, ill show you an example of the program.

Ok, your level 1 and you do job 1.



You level up and your waiting for more energy...



Now you regained your energy and did the job again, now your waiting for energy. You unlocked job 2.



Now, how would i get the timer to start to disable/enable when your waiting for energy?
Timer
Code:
If Energy.Text < 10 Then

Button1.Enabled = False
Button2.Enabled = False

Else

Button1.Enabled = True
Button2.Enabled = True

End if
Quote Originally Posted by Lyoto Machida View Post
Timer
Code:
If Energy.Text < 10 Then

Button1.Enabled = False
Button2.Enabled = False

Else

Button1.Enabled = True
Button2.Enabled = True

End if
Yea but, until you reach level 3, you CANT do job 2 (button 2), so thats what im getting at.
Quote Originally Posted by Cryptonic View Post


Yea but, until you reach level 3, you can do job 2 (button 2), so thats what im getting at.
Code:
If Energy.Text < 10 Then

Button1.Enabled = False
Button2.Enabled = False

Else
If Level.Text = 3 Then
Button2.Enabled = True
Else
Button2.Enabled = False

End if
Its easy u just need to think xD
Quote Originally Posted by Lyoto Machida View Post


Code:
If Energy.Text < 10 Then

Button1.Enabled = False
Button2.Enabled = False

Else
If Level.Text = 3 Then
Button2.Enabled = True
Else
Button2.Enabled = False

End if
Its easy u just need to think xD
Oh.. yea, brain fart, and i didnt think to do to 2 if's in one.
Quote Originally Posted by Cryptonic View Post


Oh.. yea, brain fart, and i didnt think to do to 2 if's in one.
You can do unlimited Ifs xD

SO its solved?
Quote Originally Posted by Lyoto Machida View Post


You can do unlimited Ifs xD

SO its solved?
haha, yea, ill post if i need help again.
Thread is marked as solved. Nice work.
Posts 1–15 of 34 · Page 1 of 3
This thread is closed for replies.

Tags for this Thread

None

Talk with us