Bad programming style

Blitz3D Forums/Blitz3D Programming/Bad programming style

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.

It is totally new to me that a for loop is using the stack. stack is used for nested function calls to find the return adress. For is basicly only a variable and a label including a branch-on-condition command

a=0
amax=100
.label
; whatever
a=a+1
if a< amax then goto .label

the vars are alocated anyway. No stack used as far as I see.

What you cannot do and this would leave trash on the stack is when you would leave functions with a goto, esp. when there are nested calls of multiple functions, or even recursive ones. So you soon would have a stack overrun.