******************************************************************************** function GetPrSlInfo * Description.......: Function returns the previous sale info if it exists * Calling Samples...: GetPrSlInfo(PROPID,SOURCE,DATE,"Date","C",8) * Parameter List....: tnPropid, tcSource, tdDate, tcFieldName, tcRetType (Optional), tnNumChar (Optional) * Created by........: Nadya Nosonovsky 08/15/01 12:04:59 PM * Modified by.......: Nadya Nosonovsky 08/15/01 12:05:02 PM ******************************************************************** lparameter tnPropId, tcSource, tdDate, tcFieldName, tcRetType, tnNumChar, lnRecno, lnReccount local lnSelect, lVar lnSelect=select() lnRecno = recno() && Assuming we're sitting on the correct file lnReccount = reccount() if !used('curPrevSlInfo') select 0 create cursor curPrevSlInfo (RecNum I, date D, Price I, Book I, page I) append blank endif if curPrevSlInfo.RecNum <> m.lnRecno replace RecNum with m.lnRecno in curPrevSlInfo * lVar=CreateEmptyVar(m.tcFieldName,'TranMstr') if m.tcSource = "S" and seek(str(m.tnPropId,9)+dtos(m.tdDate),"TranMstr","TrxnHist") select TranMstr set order to TrxnHist if !eof() skip if TranMstr.PropID = m.tnPropId do while TranMstr.PropID = m.tnPropId if TranMstr.source = "S" and TranMstr.date < m.tdDate replace Date with TranMstr.Date, ; Price with TranMstr.Price, ; Book with TranMstr.Book, ; Page with TranMstr.Page in curPrevSlInfo *!* scatter memvar *!* insert into curPrevSlInfo from memvar exit endif if !eof() skip else exit endif enddo endif endif endif endif lVar = evaluate('curPrevSlInfo.'+ m.tcFieldName) if m.lnRecno=m.lnReccount && Last record use in curPrevSlInfo endif select (m.lnSelect) if !empty(m.tcRetType) if vartype(m.lVar)<>m.tcRetType return ConvertType(m.lVar,m.tcRetType,m.tnNumChar) endif else return m.lVar endifI ran couple of tests in command window. If I ran it first time, when curPrevSlInfo is not created, I didn't get a Numeric Overflow error. The second time I run my test5 program, I get this error... I see some other weirdness as well. When I run this transformation for multiple records, it doesn't produce errors and the job runs till completion...