Inc(a,n) always increases 1

Here one can report bugs or hold discussions about bugs updates and work arounds.
Post Reply
Angel
Posts: 87
Joined: Sat Nov 19, 2011 9:34 am

Inc(a,n) always increases 1

Post: # 787Post Angel
Fri Dec 23, 2011 6:09 pm

Inc(a,n) does not work. Inc(a,n) =Inc(a)
The subroutine produces this result: 11,12,13, etc. Not 12,14,16...
Object frmForm As Form
  Caption="Form1"
  Height=480
  Width=640
  Center
  `Otros objetos
  Object btnButton As Button
    Tag=0
    Caption="Button1"
    Hint="Button1"
    ShowHint=True
    Left=10
    Top=10
    Height=25
    Width=75
    `Bitmap.LoadFromFile("button1.bmp")
    OnClick=btnButton_OnClick
  End Object
  `Fin otros objetos
  `Onchange=frmForm_OnChange
End Object
frmForm.showmodal
`********************************************************************************
Sub btnButton_OnClick
  Dim i As Integer,a as integer,incremento as integer
  a=10
  incremento=2
    For i =1  To 5
      inc(a,Incremento)
      showMessage a
    Next i
End Sub

Post Reply