[Gambas-user] why this code not working

Caveat Gambas at ...1950...
Tue Jul 14 19:14:02 CEST 2015


Where to begin, before we even consider scope, just try some really 
simple code first to get used to the syntax...

Public Sub Form_DblClick()

   Dim myInt As Integer
   myInt = 5
   'Inc myInt
   'Inc myInt
   'Inc myInt
   'myInt = +1
   'myInt = +10
   'myInt += 1
   'myInt += 10
   Print "myInt is now: " & myInt

End

I've commented out all the lines that might change myInt after we set it 
to 5... so try uncommenting (delete the single-quote) each line in turn 
and see what happens to myInt when you double-click on the form...

Kind regards,
Caveat


On 14/07/15 18:31, 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
> ------------------------------------------------------------------------------
> 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 at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>





More information about the User mailing list