Well, I have (had) a simple sub that returns a value.
This sub will now use the shell, so it has become a resumablesub.
It so happens that I call these sub from various points in my project, and now each sub that calls this resumablesub will also become a resumablesub, forcing me to also change the sub that called it, and so on recursively...
Is there a way to call a resumablesub without making the procedure that calls it resumablesub too?
I made a small example below to clarify the problem...
This sub will now use the shell, so it has become a resumablesub.
It so happens that I call these sub from various points in my project, and now each sub that calls this resumablesub will also become a resumablesub, forcing me to also change the sub that called it, and so on recursively...
Is there a way to call a resumablesub without making the procedure that calls it resumablesub too?
I made a small example below to clarify the problem...
B4X:
Sub OldSub As ResumableSub ' it was just a regular sub before the shell
' now this sub became resumablesub, because it's calling an old sub that became resumablesub
' now, all calls to this sub will become resumablesub, and so on...
Wait For (NewSub) complete (r As String)
Return r
End Sub
Sub NewSub As ResumableSub ' it was just a regular sub before the shell
' this sub was not resumablesub, now it's needed.
Dim sh As Shell
sh.Initialize("sh","WHAREVER.EXE",Null)
sh.Run(-1)
Wait For sh_ProcessCompleted(Success As Boolean, ExitCode As Int, StdOut As String, StdErr As String)
Return StdOut
End Sub