I kicked out the routine below to validate data that I am upsizing to SQL2000. There seems to be some invalid data in the tables and I want to detect it, log it and repair it.
With the debugger on, I watched fields that display with all ****’s NOT fail my test. I expected “an add” to a ‘****’ field to error out. I have been out of VFP for a while and my memory does not recall how to detect invalid numeric data. I appreciate you assistance and TYIA.
Robert Baker
* check numeric fields
release Nfields
numberfields = 0
FOR nCount = 1 TO gnFieldcount
if gaMyArray(nCount,2) = 'N'
zlist = addtolist(zlist, gaMyArray(nCount,1))
numberfields = numberfields + 1
declare Nfields[numberfields ]
Nfields[numberfields ] = gaMyArray(nCount,1)
endif
ENDFOR
if numberfields > 0
ON ERROR DO errhand WITH ERROR( ), MESSAGE( ), MESSAGE(1), PROGRAM( ), LINENO( )
zlist = insertintolist(zlist)
scan
zlist = addtolist(zlist, padl(str(RECNO(),6),6,'0') + ': ')
for x = 1 to numberfields
lcfield = tablename + Nfields[x]
fieldvalue = eval(Nfields[x])
** expected the next statment to error out
Z = fieldvalue + 1
zlist = addtolist(zlist, alltrim(str(fieldvalue,14,4)) )
endfor
zlist = insertintolist(zlist)
endscan
endif
Robert - Zxytek