Roberto Tsolakis Member Licensed User Longtime User Aug 1, 2017 #1 B4A Version 7.00 In module MAIN B4X: Dim Interest = MyModule.CalcInterest(1234, 5.2) ToastMessageShow(Interest,True) In module MYMODULE B4X: Sub CalcInterest(Capital As Double, Rate As Double) As Double Return Capital * Rate / 100 End Sub Logs report : Unknown memeber : CalcInterest
B4A Version 7.00 In module MAIN B4X: Dim Interest = MyModule.CalcInterest(1234, 5.2) ToastMessageShow(Interest,True) In module MYMODULE B4X: Sub CalcInterest(Capital As Double, Rate As Double) As Double Return Capital * Rate / 100 End Sub Logs report : Unknown memeber : CalcInterest
somed3v3loper Well-Known Member Licensed User Longtime User Aug 1, 2017 #2 Did you try to make it Public Sub ? Upvote 0
Jeffrey Cameron Well-Known Member Licensed User Longtime User Aug 1, 2017 #4 It's probably trying to coerce the type from a double to string, try declaring: B4X: Dim Interest As String = MyModule.CalcInterest(1234, 5.2) Upvote 0
It's probably trying to coerce the type from a double to string, try declaring: B4X: Dim Interest As String = MyModule.CalcInterest(1234, 5.2)
Star-Dust Expert Licensed User Longtime User Aug 1, 2017 #5 Jeffrey Cameron said: It's probably trying to coerce the type from a double to string, try declaring: B4X: Dim Interest As String = MyModule.CalcInterest(1234, 5.2) Click to expand... CalcInterest returns Double Upvote 0
Jeffrey Cameron said: It's probably trying to coerce the type from a double to string, try declaring: B4X: Dim Interest As String = MyModule.CalcInterest(1234, 5.2) Click to expand... CalcInterest returns Double
Jeffrey Cameron Well-Known Member Licensed User Longtime User Aug 1, 2017 #6 Sorry, meant to type "As Double" Upvote 0
Roberto Tsolakis Member Licensed User Longtime User Aug 1, 2017 #7 I've copy this code from the GUIDE BOOK of B4A, to try it. Stardust has help me ... I've used a MyMOdule as ACTIVE MODULE and not as CODE MODULE. Upvote 0
I've copy this code from the GUIDE BOOK of B4A, to try it. Stardust has help me ... I've used a MyMOdule as ACTIVE MODULE and not as CODE MODULE.