I am trying to set up a smart string literal that contains B4X code within it. The problem is that the IDE does not appear to be parsing it correctly (not seeing it as a string). See the following code and attached image for what actually occurs in the IDE.
B4X:
Dim CodeString As String = $"
'enable or disable all buttons in a list
Sub SetButtonsEnabled(ButtonsList as List, Enabled as Boolean)
For Each b as Button in ButtonsList
b.Enabled=Enabled
Next
End Sub
"$
This is a by design limitation related to the IDE performance. The IDE parser needs to build the page structure as fast as possible and handling this edge case would have a big impact on performance.
Change Sub to ~Sub or something like that and replace it: