GCSuspend()

BlitzMax Forums/BlitzMax Programming/GCSuspend()

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Yes you do, the problem you have there is when you press space its read for as long as you hold it down and all the time GCResume() is called.

Strict
Graphics 800,600

Type TFoo
Field data:Int[1000]
EndType

Local foo:TFoo

GCSuspend()
Global GCOff:Int = True

While Not KeyDown(key_escape)
foo=New TFoo
Cls
DrawText GCMemAlloced(),10,10
Flip
If KeyHit(key_space)
If GCOff=True
GCResume()
GCOff = False
EndIf
EndIf
Wend
End 


Should fix this.