Test 1 — Mobile string-returning built-in under EnableExplicit
Code: Select all
EnableExplicit
If ContainerMobile(#PB_Any, #PB_Mobile_Page)
InputMobile(1, "test", "", #PB_Mobile_Numeric)
CloseMobileContainer()
EndIf
Procedure MobileEvents()
Debug GetMobileText(1)
EndProcedure
BindEvent(#PB_Event_Mobile, @MobileEvents())Code: Select all
Calling GetMobileText$() on 3.1 produces the identical error — the $ suffix is not the issue.
Test 2 — User-defined string-returning procedure under EnableExplicit
[code]EnableExplicit
Procedure.s MyTest()
ProcedureReturn "hello"
EndProcedureTest 3 — Standard built-in string-returning function under EnableExplicit
Code: Select all
EnableExplicit
Define.s result
result = Str(42)
Debug resultTest 4 — Mobile built-in returning an integer under EnableExplicit
Code: Select all
EnableExplicit
If ContainerMobile(#PB_Any, #PB_Mobile_Page)
InputMobile(1, "test", "", #PB_Mobile_Numeric)
CloseMobileContainer()
EndIf
Procedure MobileEvents()
Debug Str(GetMobileState(1))
EndProcedure
BindEvent(#PB_Event_Mobile, @MobileEvents())Test 5 — Mobile built-in accepting a string parameter under EnableExplicit
Code: Select all
EnableExplicit
If ContainerMobile(#PB_Any, #PB_Mobile_Page)
TextMobile(1, "hello")
CloseMobileContainer()
EndIf
Procedure MobileEvents()
SetMobileText(1, "world")
EndProcedure
BindEvent(#PB_Event_Mobile, @MobileEvents())Summary
On SpiderBasic 3.1, the failure is precisely isolated to Mobile built-ins that return a string. All other combinations — user string procedures, standard string built-ins, Mobile integer-returning functions, Mobile string-accepting functions — compile and run normally under EnableExplicit on both versions.
The workaround on 3.1 is simply to omit EnableExplicit in SpiderBasic Mobile projects. Upgrading to 3.2 resolves the issue entirely.
