Reading this, in addition to seeing the need for a "Wait", I thought the
following;
Does putting the desired global variable in a class mean the class
needs to be instantiated within the scope of the code example given? i.e.
PUBLIC GlobalVar as globalVars ' Change the name of the class to ke
Private hTimer as timer as "LoopTimer"
Private bHalt as Boolean
Private iCount as integer
Public Sub LoopTimer_Timer()
if bHalt or if iCount>=10 then
bHalt = False
iCount = 0
Return
endif
inc ICount
Print iCount
hTimer.Trigger
End
Public Sub btnGo_Click()
hTimer.Trigger
End
Publ
Add a Wait instruction after n=n+1 to invoke the Event Loop. (Research the help
on this)
Also see Inc.
hth
b
On Tue, 29 Dec 2015 02:55:41 + (UTC)
Robert Boykin wrote:
> Test Program code is:
> ' Gambas class file
>
> ' Static Private iexit As Integer = 0
> Public Sub _new()
> End
>
> Publ
Test Program code is:
' Gambas class file
' Static Private iexit As Integer = 0
Public Sub _new()
End
Public Sub Form_Open()
GlobalVar.iexit = 0
End
Public Sub GObtn_Click()
Dim n As Integer
n = 0
While n < 10
Print n
n = n + 1
If GlobalVar.iexit > 0 Then Break
Wend
End
Public Sub e