Star-Dust Expert Licensed User Longtime User Jun 5, 2021 #1 An anomaly was reported to me today. A code that is marked error that is compiled and works B4X: Copy Private Sub Main log(1) Wait For (Pausa) Complete ' Don't write (Result a Boolean) log(2) End Sub Private Sub Pausa As ResumableSub Sleep(4000) ' don't write Return Boolean End Sub It works in B4A, B4J but it doesn't work in B4i. I guess it's an anomaly, it shouldn't wait if the COMPLETE doesn't return anything. It should not compile if the ResumableSub does not return a value Attachments WaitForComplete.zip WaitForComplete.zip 14 KB · Views: 475
An anomaly was reported to me today. A code that is marked error that is compiled and works B4X: Copy Private Sub Main log(1) Wait For (Pausa) Complete ' Don't write (Result a Boolean) log(2) End Sub Private Sub Pausa As ResumableSub Sleep(4000) ' don't write Return Boolean End Sub It works in B4A, B4J but it doesn't work in B4i. I guess it's an anomaly, it shouldn't wait if the COMPLETE doesn't return anything. It should not compile if the ResumableSub does not return a value
LucaMs Expert Licensed User Longtime User Jun 5, 2021 #2 Note that in b4a and b4j it would work even if Pause returned a value (I don't know in B4i because... you know).
Note that in b4a and b4j it would work even if Pause returned a value (I don't know in B4i because... you know).
Star-Dust Expert Licensed User Longtime User Jun 5, 2021 #3 LucaMs said: Note that in b4a and b4j it would work even if Pause returned a value (I don't know in B4i because... you know). Click to expand... In b4i it only works if it is written correctly. If the return is missing or if the value after COMPLETE is missing it does not work
LucaMs said: Note that in b4a and b4j it would work even if Pause returned a value (I don't know in B4i because... you know). Click to expand... In b4i it only works if it is written correctly. If the return is missing or if the value after COMPLETE is missing it does not work
aeric Expert Licensed User Longtime User Jun 5, 2021 #4 Is it because B4A and B4J compile to Java while B4i compiles to Objective-C code so they are different?
Is it because B4A and B4J compile to Java while B4i compiles to Objective-C code so they are different?
Star-Dust Expert Licensed User Longtime User Jun 5, 2021 #5 Beyond the practical reason I suppose it is not the expected behavior otherwise it would behave the same on all platforms
Beyond the practical reason I suppose it is not the expected behavior otherwise it would behave the same on all platforms
LucaMs Expert Licensed User Longtime User Jun 5, 2021 #6 Well, often I write something like: B4X: Copy Wait For(Something) Complete(Unused As Boolean) and, of course, I don't need that "Unused variable" (at least there). Now I can simply write: B4X: Copy Wait For(Something) Complete to get what I need. Are you sure that it does not work in B4i?
Well, often I write something like: B4X: Copy Wait For(Something) Complete(Unused As Boolean) and, of course, I don't need that "Unused variable" (at least there). Now I can simply write: B4X: Copy Wait For(Something) Complete to get what I need. Are you sure that it does not work in B4i?
Star-Dust Expert Licensed User Longtime User Jun 5, 2021 #7 I'm sure it doesn't work in b4i In any case, regardless of how it works on B4i, I wanted an answer from Erel to understand if this is an expected behavior. Since Erel has always suggested to insert a variable even without any significant value
I'm sure it doesn't work in b4i In any case, regardless of how it works on B4i, I wanted an answer from Erel to understand if this is an expected behavior. Since Erel has always suggested to insert a variable even without any significant value
LucaMs Expert Licensed User Longtime User Jun 5, 2021 #8 Star-Dust said: I'm sure it doesn't work in b4i In any case, regardless of how it works on B4i, I wanted an answer from Erel to understand if this is an expected behavior. Since Erel has always suggested to insert a variable even without any significant value Click to expand... Too bad we always have to wait for Erel. Should there be more than one Erel or we should force him to work 7 days a week ?
Star-Dust said: I'm sure it doesn't work in b4i In any case, regardless of how it works on B4i, I wanted an answer from Erel to understand if this is an expected behavior. Since Erel has always suggested to insert a variable even without any significant value Click to expand... Too bad we always have to wait for Erel. Should there be more than one Erel or we should force him to work 7 days a week ?
Erel B4X founder Staff member Licensed User Longtime User Jun 6, 2021 #9 This is considered invalid syntax, as a single parameter is always expected: Code: Copy Wait For (Pausa) Complete I will make the compiler warn about this.
This is considered invalid syntax, as a single parameter is always expected: Code: Copy Wait For (Pausa) Complete I will make the compiler warn about this.
Star-Dust Expert Licensed User Longtime User Jun 6, 2021 #10 Thanks Erel, it's not a big deal. It was just to confirm what I thought.
Sandman Expert Licensed User Longtime User Jun 6, 2021 #11 Erel said: I will make the compiler warn about this. Click to expand... And perhaps the IDE?
Star-Dust Expert Licensed User Longtime User Jun 6, 2021 #12 Sandman said: And perhaps the IDE? Click to expand... The IDE already signals a WARNING if there is no Return at the end of a ResumableSub
Sandman said: And perhaps the IDE? Click to expand... The IDE already signals a WARNING if there is no Return at the end of a ResumableSub
Sandman Expert Licensed User Longtime User Jun 6, 2021 #13 Star-Dust said: The IDE already signals a WARNING if there is no Return at the end of a ResumableSub Click to expand... Oh, right, I forgot - thanks
Star-Dust said: The IDE already signals a WARNING if there is no Return at the end of a ResumableSub Click to expand... Oh, right, I forgot - thanks
Erel B4X founder Staff member Licensed User Longtime User Jun 6, 2021 #14 Sandman said: And perhaps the IDE? Click to expand... The IDE shows the compiler warnings. These are two connected components. It happens in the background while the developer types the code.
Sandman said: And perhaps the IDE? Click to expand... The IDE shows the compiler warnings. These are two connected components. It happens in the background while the developer types the code.