i'm developing a program that puts a menu of items on the screen and provides its own block cursor, so it begins by clearing the screen and turning off the cursor with LOCATE ,,0.
i noticed that the cursor did not always turn off. upon further investigation i found that it turns off the cursor the first time i run it but on subsequent runs, the cursor remains on. if i run a different program in between, it works again, once.
i later discovered that this happens even if you use ASM and manipulate the cursor with INT 16. two programs that call INT 16 with different values in the registers work if run alternatively, but neither works twice in a row.
this may not be a freebasic issue but it sure is odd.
asm
mov ah,1
mov cx,0x20
int 0x10
end asm
i am using freebasic dos 0.17 and windows xp
turning the cursor off
locate ,,1 has no effect.
here is a complete program that shows the problem. the first time you run it, the cursor is off. on subsequent runs, the cursor remains on.
here is a complete program that shows the problem. the first time you run it, the cursor is off. on subsequent runs, the cursor remains on.
Code: Select all
locate ,,0
cls
locate 10,15
print "hello world"
dim k as integer
k = getkey
locate ,,1
i found a workaround for this issue
i added a 150 ms delay before turning off the cursor ...
a delay of 100 ms works sometimes but 150 works every time
i added a 150 ms delay before turning off the cursor ...
Code: Select all
sleep 150
locate ,,0