Roger Daley Well-Known Member Licensed User Longtime User Dec 26, 2016 #1 Hi All Exposing myself to appear really dumb but what does this really mean? "Return type (in Sub signature) should be set explicitly." Yes I understand the words. Yes, I know I can ignore it but I would prefer use 'Return' correctly. Perhaps a correct and an incorrect example would help. Regards Roger
Hi All Exposing myself to appear really dumb but what does this really mean? "Return type (in Sub signature) should be set explicitly." Yes I understand the words. Yes, I know I can ignore it but I would prefer use 'Return' correctly. Perhaps a correct and an incorrect example would help. Regards Roger
Erel B4X founder Staff member Licensed User Longtime User Dec 26, 2016 #2 Incorrect: Code: Sub Sum(x As Int, Y As Int) Return x + y 'the value will be converted to string as the return type is not explicitly set. End Sub Correct: Code: Sub Multiply(x As Int, Y As Int) As Int Return X * Y End Sub Upvote 0
Incorrect: Code: Sub Sum(x As Int, Y As Int) Return x + y 'the value will be converted to string as the return type is not explicitly set. End Sub Correct: Code: Sub Multiply(x As Int, Y As Int) As Int Return X * Y End Sub
Roger Daley Well-Known Member Licensed User Longtime User Dec 26, 2016 #3 Thanks Erel, So obvious when someone tells you. Regards Roger Upvote 0