This is almost certainly a bug or odd setting in the default windows 11 terminal. I changed the default terminal setting from "Let Windows Decide" to "Windows Console Host" and now things work.
I've pared down a bug in my project to this basic example. There appears to be some kind of memory corruption going on when calling print a bunch of times:
Code: Select all
type UDT
declare constructor()
dim value as integer
end type
constructor UDT()
print "constructor!"
for i as integer = 0 to 5
print i
next
end constructor
print "start"
dim test as UDT
dim test2 as UDT
dim test3 as UDT
dim test4 as UDT
print "finish"
sleep
Code: Select all
const
0
1
2
3
4
5
co
0
1
2
3
4
5
co
0
1
2
3
4
5
co
0
1
2
3
4
5
fi
This will print normal and expected results if you were to, say, remove one of the 'dim test as UDT', but this shouldn't otherwise be wrong.
This is on windows 11 (and windows subsystem for linux 2.0), fbc 1.09, compiled with no extra flags. Does anyone else see this behavior happening? This seems so basic that the only thing to blame would be windows...