Xojo Conferences

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.

Feedback, Comments & Corrections

The biggest plugin in space...

MBS Xojo PDF Plugins