PROCEDURE NewMessage LPARAMETERS CONNECTION *********************************************************** * This event fires when we receive a message * from the remote system *********************************************************** ltNowDate=DTOC(DATE()) gnMessages=gnMessages+1 ***************************************************************** * Get the message from the connection object into a string * varaible, and save it as a file ***************************************************************** WAIT [Reading Incoming....] WINDOW nowait dataReceived = CONNECTION.readmessage * Update MessageWindow IF VARTYPE(cthmainvlist)=[O] cthmainvlist.edit1.VALUE = datareceived cthmainvlist.label7.caption=[Last Msg: ]+TRANSFORM(DATETIME()) cthmainvlist.REFRESH() ENDIF =STRTOFILE(datareceived+CHR(10)+CHR(13),"msglog.log",1) DO Processmessage WITH datareceived