We need to implement a sub that calls several other subs in a specific order. Each of these subs returns True if the sub was executed successfully and false otherwise.
If any sub returned false then we should stop calling other subs and return false. If all subs returned true then we need to return true.
Please use the Spoiler tag in your answer:
It is of course very simple to implement this. The challenge is to write an elegant solution.
If any sub returned false then we should stop calling other subs and return false. If all subs returned true then we need to return true.
B4X:
Sub DoSeveralTasks As Boolean
'call TaskA. If good continue to TaskB and so on...
End Sub
Sub TaskA(...) As Boolean
End Sub
Sub TaskB(...) As Boolean
End Sub
'more subs here. Each with a different name and a different number of parameters.
Please use the Spoiler tag in your answer:
It is of course very simple to implement this. The challenge is to write an elegant solution.
Last edited: