>LPARAMETERS tcTable > >LOCAL lnHnd, lnHdrStart, lnHdrSize, lcBackLink > >*** Check that the file exists >IF ! FILE( tcTable ) > ERROR "9000: Cannot locate file " + tcTable > RETURN .F. >ENDIF > >*** Open the file at low level - Read Only if just reading info >lnHnd = FOPEN( tcTable, IIF( lnParms > 1, 2, 0) ) > >*** Check file is open >IF lnHnd > 0 > *** Backlink is last 263 bytes of the header so calculate position > *** Max header size is (32 + ( 255 * 32 ) + 264) = 8456 Bytes > lcStr = FREAD( lnHnd, 8456 ) > *** Field records end with 13 NULLS + "CR" > lcFieldEnd = REPLICATE( CHR(0), 13 ) + CHR(13) > lnHeaderStart = AT( lcFieldEnd, lcStr ) + 13 > *** Move file pointer to header start position > FSEEK( lnHnd, lnHeaderStart ) > *** Read backlink > lcBackLink = UPPER( ALLTRIM( STRTRAN( FGETS( lnHnd, 263 ), CHR(0) ) ) ) >ELSE > *** Mayday mayday! Cannot open table >ENDIF >>