J jai Active Member Licensed User Longtime User May 26, 2019 #1 While placing a Sleep(0) statement in an otherwise working code two error messages get triggered in the Log window- Object reference not set to an instance of object Expected non code block The app cannot be compiled in this condition. If Sleep(0) is remmed out the problem goes away- I am exploring replacing DoEvents with Sleep(0) but can't get started because of this unexpected error.
While placing a Sleep(0) statement in an otherwise working code two error messages get triggered in the Log window- Object reference not set to an instance of object Expected non code block The app cannot be compiled in this condition. If Sleep(0) is remmed out the problem goes away- I am exploring replacing DoEvents with Sleep(0) but can't get started because of this unexpected error.
Erel B4X founder Staff member Licensed User Longtime User May 26, 2019 #2 Hard to say without seeing the code. Can you upload it? If not send it to [email protected]. Note that Sleep(0) behavior is not identical to DoEvents. You do need to learn about resumable subs. Worth watching: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255570732 Upvote 0
Hard to say without seeing the code. Can you upload it? If not send it to [email protected]. Note that Sleep(0) behavior is not identical to DoEvents. You do need to learn about resumable subs. Worth watching: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=255570732
Erel B4X founder Staff member Licensed User Longtime User May 27, 2019 #3 This is a bug related to this line: Code: s3=s1:If s3>4 Then s3=s3-4 It will work if you change it to: Code: s3=s1 If s3>4 Then s3=s3-4 Last edited: May 27, 2019 Upvote 0
This is a bug related to this line: Code: s3=s1:If s3>4 Then s3=s3-4 It will work if you change it to: Code: s3=s1 If s3>4 Then s3=s3-4
J jai Active Member Licensed User Longtime User May 28, 2019 #4 That does it! Thanks much for your help. Should multiple statements on a single line be always avoided or was there something peculiar about my statements? Upvote 0
That does it! Thanks much for your help. Should multiple statements on a single line be always avoided or was there something peculiar about my statements?
Erel B4X founder Staff member Licensed User Longtime User May 29, 2019 #5 In most cases you can use multiple statements, however they are not recommended. Upvote 0