Android Question Unknown member ...

Roberto Tsolakis

Member
Licensed User
Longtime User
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
 

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
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

Star-Dust

Expert
Licensed User
Longtime User
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)
CalcInterest returns Double
 
Upvote 0

Roberto Tsolakis

Member
Licensed User
Longtime User
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
Top