MBS Xojo Developer Conference and Training
Join us from 3rd to 6th May 2017 in Berlin, Germany.

Platforms to show: All Mac Windows Linux Cross-Platform

FAQ.How to get the current free stack space?

Answer: You can something like the code below:
Sub ShowStackSize()
dim threadid as Integer
dim size as Integer

declare function GetCurrentThread lib "Carbon" (byref threadid as Integer) as short
declare function ThreadCurrentStackSpace lib "Carbon" (threadid as Integer, byref size as Integer) as short

if GetCurrentThread(threadid)=0 then
if 0=ThreadCurrentStackSpace(threadid,size) then
MsgBox str(size)
end if
end if
End Sub
Notes: For Mac OS 9, use "ThreadLib" instead of "CarbonLib". You can use #if if you like for that.

MBS FileMaker blog