I am stuck here....I am trying to call "multiply" from "add" and passing a value of 5 to "multiply" from "add". But I get this error:
Please help this dummy (me) to understand what it is that I am missing....
B4X:
b4r_main.cpp:13: error: 'multiply' was not declared in this scope
Please help this dummy (me) to understand what it is that I am missing....
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private Result, N1, N2 As Int 'ignore
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
N1 = 10
N2 = 20
RunNative("add", Null)
Log("Result: ", Result)
End Sub
#if C
void add (B4R::Object* o) {
//lower case variables
b4r_main::_result = b4r_main::_n1 + b4r_main::_n2;
multiply(5); //THE ERROR IS HERE! b4r_main.cpp:13: error: 'multiply' was not declared in this scope
}
void multiply (int d) {
//lower case variables
b4r_main::_result = b4r_main::_n1 * d;
}
#End if