Dim Serialinput as Byte
Dim Outpt as Byte
Dim Outpnt as Byte
Dim Stuff as Byte
Dim Messg as Byte

if Ischarwaiting() = 1 then
Serialinput = inkey()
if Stuff = 0 and Serialinput = "a" then
Stuff = 1
else
If Stuff = 1 and Serialinput <> "a" then
Stuff = 0
Messg = 1
Outpnt = 1

Outpt(Outpnt) = Serialinput
Incr Outpnt

Else
 If Messg = 1 then
Outpt(Outpnt) = Temp
Incr Outpnt
End if
End if
Stuff = 0
End if 
End if

Outpt(Outpnt) = Temp
Incr Outpnt
If Outpnt >= 11 then

End if