ot = CREATEOBJECT('mscommlib.mscomm') ot.CommPort = 4 ot.Settings='115200,n,8,1' ot.PortOpen = .T. lqout = 0hA0A20001B700B7B0B3 ot.Output = lqout lqin = ot.Input ot.PortOpen = .F. CREATE CURSOR test (testrec Q(100)) INSERT INTO test VALUES(lqin)But when I run the same code in a PRG, the contents of the input buffer are cleared before being assigned to the local varuable.