with this little program the stackbuffer goes over 3000 !?
is there a possibility to clean the stack between this loop?
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 3100
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
For t = 1 To 256
Log (Asc(t))
Log("stack :",StackBufferUsage)
Delay (100)
Next
End Sub
1. You are not using Asc correctly. Asc expects a string. I think that you are actually looking for Chr which doesn't exist in B4R because strings are arrays of bytes.
Correct code:
B4X:
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
Dim b(1) As Byte
For t = 1 To 256
b(0) = t
Log(b)
Log("stack :",StackBufferUsage)
Delay (100)
Next
End Sub