The input macro has a problem with a missing null terminator on the txt db prompt statement. The problem becomes apparent when an instance of the macro is called in a loop and, after the first call, whatever happens to be in the buffer string appears at the end of the prompt.
Michael,
Thanks for posting this one, I could duplicate the problem with the following code.
main proc
LOCAL lpstring :DWORD
LOCAL cnt :DWORD
mov cnt, 3
cls
print "Input Test"
print chr$(13,10,0)
@@:
mov lpstring, input("Type text here : ")
print lpstring
print chr$(13,10,0)
sub cnt, 1
jnz @B
exit
main endp
I changed the input macro only by appending a zero on the txt variable.
.data
txt db prompt, 0
buffer db 128 dup (0)
align 4
.code
It seems to work correctly now.