Re: [Gambas-user] POSSIBLE! bug in while loop

2015-12-29 Thread Stephen
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

Re: [Gambas-user] POSSIBLE! bug in while loop

2015-12-29 Thread Fabien Bodard
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

Re: [Gambas-user] POSSIBLE! bug in while loop

2015-12-28 Thread adamn...@gmail.com
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

[Gambas-user] POSSIBLE! bug in while loop

2015-12-28 Thread Robert Boykin
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