KMatle Expert Licensed User Longtime User Mar 1, 2022 #1 I try to pass the two variables from Inline C (without using global variables): from and &msg to a sub in B4R giving b4r_main.cpp:85:35: error: no matching function for call to 'b4r_main::_newmessage(uint32_t&, String*)' Click to expand... B4X: void receivedCallback( uint32_t from, String &msg ) { Serial.printf("Received from %u msg=%s\n", from, msg.c_str()); b4r_main::_newmessage(from, &msg); } B4X: Sub newmessage(node As ULong, m As String) Log(node,"->",m) End Sub The second one seems to be a String pointer. Can someone give me a hint here?
I try to pass the two variables from Inline C (without using global variables): from and &msg to a sub in B4R giving b4r_main.cpp:85:35: error: no matching function for call to 'b4r_main::_newmessage(uint32_t&, String*)' Click to expand... B4X: void receivedCallback( uint32_t from, String &msg ) { Serial.printf("Received from %u msg=%s\n", from, msg.c_str()); b4r_main::_newmessage(from, &msg); } B4X: Sub newmessage(node As ULong, m As String) Log(node,"->",m) End Sub The second one seems to be a String pointer. Can someone give me a hint here?
Erel B4X founder Staff member Licensed User Longtime User Mar 2, 2022 #2 B4RString is no the same thing as String. Check this code: https://www.b4x.com/android/forum/threads/how-to-convert-string-to-b4rstring.138236/post-875169 Upvote 0
B4RString is no the same thing as String. Check this code: https://www.b4x.com/android/forum/threads/how-to-convert-string-to-b4rstring.138236/post-875169