CyclopDroid Well-Known Member Licensed User Longtime User May 20, 2016 #1 For pause the change of my card, I use a Doevent into sub: Code: Copy Sub attesa(sec As Double) Dim Ti As Long Ti = DateTime.Now + (sec * 1000) '1000=1 Secondo Do While DateTime.Now < Ti DoEvents Loop End Sub I Call this sub whit example: Code: Copy .... For nCarta=0 To 4 If CardChange(k)=1 then imgCard(nCarta).Enabled=False imgCard(nCarta).Bitmap=LoadBitmap(File.DirAssets,ListaCarte.get(nCarta) & ".png") attesa(.3) ListaCarte.Set(k,ListaCarte.get(k+Cambio)) CardChange(k)=0 End If Next .... In the smartphone it' work but into Android TV it's wrong and exit program. If I delete DoEvents, dont exit but the image not refresh. The DoEvents have a problem with Android TV. How can I change this sub to make sure that you do the same and refresh the page and the pictures? Thanks Last edited: May 20, 2016
For pause the change of my card, I use a Doevent into sub: Code: Copy Sub attesa(sec As Double) Dim Ti As Long Ti = DateTime.Now + (sec * 1000) '1000=1 Secondo Do While DateTime.Now < Ti DoEvents Loop End Sub I Call this sub whit example: Code: Copy .... For nCarta=0 To 4 If CardChange(k)=1 then imgCard(nCarta).Enabled=False imgCard(nCarta).Bitmap=LoadBitmap(File.DirAssets,ListaCarte.get(nCarta) & ".png") attesa(.3) ListaCarte.Set(k,ListaCarte.get(k+Cambio)) CardChange(k)=0 End If Next .... In the smartphone it' work but into Android TV it's wrong and exit program. If I delete DoEvents, dont exit but the image not refresh. The DoEvents have a problem with Android TV. How can I change this sub to make sure that you do the same and refresh the page and the pictures? Thanks
NJDude Expert Licensed User Longtime User May 20, 2016 #2 You should not do that, better use a Timer. Upvote 0
CyclopDroid Well-Known Member Licensed User Longtime User May 20, 2016 #3 The problem is that using a timer, the codes inside the SUB continue without putting paused. I using this sub in other parts and not stopped. Upvote 0
The problem is that using a timer, the codes inside the SUB continue without putting paused. I using this sub in other parts and not stopped.
NJDude Expert Licensed User Longtime User May 20, 2016 #4 Then change your code, that way of programming is not really recommended. Upvote 0
CyclopDroid Well-Known Member Licensed User Longtime User May 20, 2016 #5 Unfortunately, the game is already finish and it works perfectly on smartphones (I have not tried it on Android 4.4) .. the problem is that, because of that Sub, not only works on Android TV. Change all require a long time and know if it would work on. If we not only alternatives to modify this DoEvents think that's the only way to change everything ... or not to publish it on TV. Upvote 0
Unfortunately, the game is already finish and it works perfectly on smartphones (I have not tried it on Android 4.4) .. the problem is that, because of that Sub, not only works on Android TV. Change all require a long time and know if it would work on. If we not only alternatives to modify this DoEvents think that's the only way to change everything ... or not to publish it on TV.