As explained in the tutorial about memory management in B4R: https://www.b4x.com/android/forum/threads/65672/#content it is not trivial to assign the value of a local, non-numeric, variable to a global variable. The reason behind this limitation is that the memory is statically allocated during...
www.b4x.com
Globalstore can be easily used from b4r. I tried to use it in in line C but I could not do it.
What I want to do is convert a number to char and add it in GlobalStore. Any help will be highly appreciated. Here is what I have got so far:
B4X:
#if C
void trial(B4R::Object* o) {
ULong num = (o->toULong());
char _texttodisplay;
_texttodisplay = (char) num;
B4R::B4RString _ttds;
_ttds.wrap(&_texttodisplay);
//This line does not work (it requires a B4R::Array*)
//b4r_main::_globalstore->_put (2,(_ttds)->GetBytes());
}
#End If