I am wondering if there is a way to reuse B4A activity code modules with B4I (without having to create a new file). In theory, if I am not mistaken the only difference is in the file header and the rest can be done using
#if B4A etc..
Can someone please comment on this
Erel, do you see any issue in creating a utility that changes the header information in the .bas file.
This will allow reusing the activity module as static code module with B4I, and change it back to an activity module later on as needed.
Did you find any issues with doing this iCAB?
It sounds like a great workaround, just a pity the switching can't be done with #if B4a and #if B4i conditional compilation.
Did you find any issues with doing this iCAB?
It sounds like a great workaround, just a pity the switching can't be done with #if B4a and #if B4i conditional compilation.
I had to play around a bit with the directives. But it is working perfectly ok for me.
I am reusing the same code as iswith the help of NotePad++ ( search and replace ), and most likely soon enough I will write a small utility that does this.
Thanks iCAB. I have also got it working, however I discovered you can't even leave a space after the "Type=StaticCode" or it will not work.
I include the "find & replace" tips right near the top of the code in comments so I can remember what to swap for b4a and b4i. Only 4 files so its more of a nuisance than time consuming.
I am glad you did get it to work. The biggest challenge for me was not related to search and replace, but instead it was the program flow and variables life cycle.