WITH this.oleweight IF TYPE("NVL(_screen.oapp,'')") = "O" LOCAL lnnum, lnSecs, lnNumber, lnDataLen, x LOCAL lacodes[1] lnDataLen = _screen.oapp.osite.WS_datalength lnStartPos = _screen.oapp.osite.ws_lentodata IF .inBufferCount >= (lnDataLen*2) this.lScaleIndicatorError = .f. this.tlastreadtime = DATETIME() lcnum = .input * this is used for debug in production. IF FILE("logscale.txt") STRTOFILE(lcnum,"scallog.txt",1) ENDIF this.clastscalestring = lcNum * gets the last valid weight. IF RAT(CHR(13),lcnum,1) > 0 lcnum = SUBSTR(lcnum,RAT(CHR(13),lcnum,1)-lnDataLen,lnDataLen) ENDIF IF LEN(lcNum) < 10 RETURN ENDIF lcnum = SUBSTR(lcnum,lnStartPos,7) * more debug code for production. IF FILE("logscale.txt") STRTOFILE(lcnum+CRLF,"ScaleNum.txt",1) ENDIF lnNumber = INT(VAL(retnum(lcnum))) *display a negative number IF ATC("-",lcnum) > 0 lnNumber = lnNumber * -1 ENDIF * this is used to freeze the weight on the computer screen while the user is * filing in ticket info IF NOT thisform.lFrezzWeight this.txtweight.Value = lnNumber this.txtweight.Refresh() ELSE IF lnNumber < 400 AND NOT this.lreprint this.cleanup() ENDIF ENDIF ELSE IF EMPTY(this.tlastreadtime) this.tlastreadtime = DATETIME() ENDIF IF DATETIME()- this.tlastreadtime > 10 this.lScaleIndicatorError = .t. ENDIF ENDIF IF NOT ISNULL(this.tstarttime) * times out application if weight is not completed in a specific time frame. IF DATETIME() - this.tstarttime > 60*this.ntimeout thisform.processticket(.f.) ENDIF ENDIF ELSE .interval = 0 ENDIF ENDWITH>Hello Experts...
> SET OLEOBJECT ON > oComm = CREATEOBJECT('MSCOMMLib.MSComm') > oComm.CommPort = 1 > oComm.Settings = "1200,N,8,1" > oComm.InputLen = 0 > oComm.PortOpen = .T. > > II = oComm.input > > =MESSAGEBIOX(II) > > oComm.PortOpen = .F. > > RETURN > >>