* Called from a timer - interested in GGA and GSA data only * load mscomm oComm = CREATEOBJ('MSCOMMLib.MSComm') * Open and Initialize COM port #1 for use With oComm .CommPort = 1 .Settings = "4800,N,8,1" .InputLen = 1 .PortOpen = .T. lcDATA='' lnStart = datetime() llDataReady = .F. Do while datetime()-lnStart < 5 .InputLen = 1 lcDATA = lcDATA+.input lnGGA = at('$GPGGA',lcData) lnGSA = at('$GPGSA',lcData) If lnGGA > 0 and lnGSA > lnGGA && Read enough llDataReady = .T. Exit Endif Enddo * Close the port .PortOpen = .F. Endwith Release oComm if llDataReady thisform.WriteGPSData(lcData, datetime()) && writing to a table else wait window timeout 2 'GPS timedout!' endifCetin