Alessandro71 Well-Known Member Licensed User Longtime User Jun 25, 2025 #1 I have many classes that I use in cross-platform app projects that are using XUI.SubExists before calling CallSub. I'm writing a Server project that will use the same classes. I know I can't use XUI in a NON-UI project, so all XUI.SubExists are marked as errors. I also tried to make my own XUI code module which redefines SubExists, but as soon as I type "Public Sub SubExists" the identifier is marked as error because it's a reserved keyword. Is there any solution to this aside from wrapping each call like this? B4X: #if SERVER if SubEsists(module, subname) ... #else if xui.SubEsists(module, subname, params) ... #end if
I have many classes that I use in cross-platform app projects that are using XUI.SubExists before calling CallSub. I'm writing a Server project that will use the same classes. I know I can't use XUI in a NON-UI project, so all XUI.SubExists are marked as errors. I also tried to make my own XUI code module which redefines SubExists, but as soon as I type "Public Sub SubExists" the identifier is marked as error because it's a reserved keyword. Is there any solution to this aside from wrapping each call like this? B4X: #if SERVER if SubEsists(module, subname) ... #else if xui.SubEsists(module, subname, params) ... #end if
stevel05 Expert Licensed User Longtime User Jun 25, 2025 #2 You can't redefine the method as you said, but you could give it a different name in a code module Something Like: B4X: Public Sub DoesSubExist(Module as Object, SubName as String, Params() as Object) As Boolean #if SERVER if SubExists(Module, SubName) Then Return True #else if xui.SubExists(Module, SubName, Params) Then Return True #end if Return False End Sub Not Tested and may need tweaking. Upvote 0
You can't redefine the method as you said, but you could give it a different name in a code module Something Like: B4X: Public Sub DoesSubExist(Module as Object, SubName as String, Params() as Object) As Boolean #if SERVER if SubExists(Module, SubName) Then Return True #else if xui.SubExists(Module, SubName, Params) Then Return True #end if Return False End Sub Not Tested and may need tweaking.
Alessandro71 Well-Known Member Licensed User Longtime User Jun 25, 2025 #3 yes, even if it would require modifying all sources with xui.SubExists calls with STUBMODULE.DoesSubExist. it kinda voids the main purpose of using xui.SubExists (cross-platform source). Upvote 0
yes, even if it would require modifying all sources with xui.SubExists calls with STUBMODULE.DoesSubExist. it kinda voids the main purpose of using xui.SubExists (cross-platform source).
LucaMs Expert Licensed User Longtime User Jun 25, 2025 #4 Alessandro71 said: it kinda voids the main purpose of using xui.SubExists (cross-platform source). Click to expand... The "sad" thing is that you can't use graphics in a server project (which is why you can't use XUI). Upvote 0
Alessandro71 said: it kinda voids the main purpose of using xui.SubExists (cross-platform source). Click to expand... The "sad" thing is that you can't use graphics in a server project (which is why you can't use XUI).
Alessandro71 Well-Known Member Licensed User Longtime User Jun 25, 2025 #5 LucaMs said: The "sad" thing is that you can't use graphics in a server project (which is why you can't use XUI). Click to expand... true, but out of scope in this issue (using existing code in server modules) Upvote 0
LucaMs said: The "sad" thing is that you can't use graphics in a server project (which is why you can't use XUI). Click to expand... true, but out of scope in this issue (using existing code in server modules)