On 07/14/2015 12:31 PM, tsukuba GIMP user wrote:
> Public Sub PictureBox1_MouseDown()
>
>    Dim dicer As Integer
>    Dim dbclick As Integer
>    dicer = Int(Rnd(1, 5))
>    dbclick = +1 <-------------------------------Problem code
>    If dbclick = 8 Then <------- i click 8 time but it's don't run this code 
> just like my program forget this code
>      Form3.Text = ("xxxxx")
>      Form3.TextBox1.text = ("xxxxxx!!!!!!!")
>      Form3.Show
>    Else
>      Goto just_keep_moveing
>    Endif
>    just_keep_moveing:
>    If dicer = 1 Then
>      Form3.Text = ("xxxx")
>      Form3.TextBox1.Text = ("xxxxxxx~")
>      Form3.Show
>    Else If dicer = 2 Then
>      Form3.Text = ("xxxx")
>      Form3.TextBox1.text = ("xxxxx!xxxx!")
>      Form3.Show
>    Else If dicer = 3 Then
>      Form3.Text = ("xxxx")
>      Form3.TextBox1.text = ("xxxxxxx?")
>      Form3.Show
>    Else If dicer = 4 Then
>      Form3.Text = ("xxxx")
>      Form3.TextBox1.text = ("xxxx!")
>      Form3.Show
>    Endif
> End

There are a couple of reasons why the code doesn't work as I think you are 
expecting.

1. Because the syntax, "dbclick = +1", assigns positive 1 to dbclick each time 
it is executed. The syntax should be "dbclick += 
1", or "Inc dbclick".

2. You have declared dbclick within the function and it therefore gets, 
essentially, reset to 0 on each call of the function.


Lee
__________


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to