It's not just the loop:
This fails as well with no loops:
test = 255
load dll "user32.dll",test
temp = 1
print "Loop number="
print temp
print "Variable test="
print test
print "Click to continue with this trial"
suspend for key
call dll test,"GetSystemMetrics",0
inc temp
print "Loop number="
print temp
print "Variable test="
print test
print "Click to continue with this trial"
suspend for key
call dll test,"GetSystemMetrics",0
inc temp
print "Loop number="
print temp
print "Variable test="
print test
print "Click to continue with this trial"
suspend for key
call dll test,"GetSystemMetrics",0
inc temp
It seems to happen when the dll returns a value and a return variable isn't specified as the variable "test" is changed to is my screen width in the case of the example and the height in this example:
test = 255
load dll "user32.dll",test
temp = 1
print "Loop number="
print temp
print "Variable test="
print test
print "Click to continue with this trial"
suspend for key
call dll test,"GetSystemMetrics",1
inc temp
print "Loop number="
print temp
print "Variable test="
print test
print "Click to continue with this trial"
suspend for key
call dll test,"GetSystemMetrics",1
inc temp
print "Loop number="
print temp
print "Variable test="
print test
print "Click to continue with this trial"
suspend for key
call dll test,"GetSystemMetrics",1
inc temp
Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!