LPARAMETERS vcAddr *** Performs a gross check on an input value *** to see if it generally meets the criteria *** for a valid address. *** vcAddr - The value to be checked *** Returns .T. or .F. LOCAL llRetVal LOCAL x LOCAL lnWordEnd LOCAL lcWord *** An address is probably invalid if *** it is empty (duh?) or it is all digits *** (e.g "1234") or if it contains only *** one word (e.g. "Main") or it has no *** digits ( e.g. "Main St") *** o If it containst the string PO BOX *** then it is pro'ly valid. *** o If it contains the strings RR and *** BOX (i.e. RR 11 BOX 2) then it *** is pro'ly valid llRetVal = .F. * Don't change the default value if: * - there aren't at least two words * - the address is all digitis * - the address doesn't follow * general format of street * number, street name * Check to see if it's an address that gets * special processing * - the address is less than * five characters IF EMPTY( vcAddr) llRetVal = .F. ELSE IF NOT ( " " $ ALLTRIM( vcAddr) ) llRetVal = .F. ELSE IF LEN( ALLTRIM( vcAddr)) < 5 llRetVal = .F. ELSE IF THIS.AllDigits( vcAddr) llRetVal = .F. ELSE llRetVal = .T. ENDIF ENDIF ENDIF ENDIF IF EMPTY( vcAddr) lcWord = "" ELSE lnWordEnd = AT( " ", vcAddr) IF lnWordEnd = 0 lnWordEnd = LEN( vcAddr) ENDIF lcWord = SUBSTR( vcAddr, 1, lnWordEnd) ENDIF * The above used to be a simple * lcWord = WORDNUM( vcAddr, 1) * but the above code seemed to work better * for a while IF VAL( lcWord) = 0 ... snipThe PROGRAM blows up ON THIS LINE