... lcPrevCIFCCode = "" ... Do While Not llEOF && of Stops source records Store "" To lcStopNo, lcName, lcLoc1, lcLoc2, lcCountyCode, lcDistrictCode Store 0 To lnZoneNo, lnEastings, lnNorthings .cString = .lmReadString( .nStopsHdl) && Get a line of source lnDone = lnDone + 1 If EMPTY( .cString) ; Or FEOF( .nStopsHdl) && if no data or at eof llEOF = .T. Else lcRecID = SUBSTR( .cString, 1, 2) If lcRecID <> "QL"; And lcRecID <> "QB" && not locn header rec (QL) or add. locn rec (QB) llEOF = .T. && NOTE continue from here with OPERATOR dets Else && QL or QB record lcCIFCCode = ALLTRIM( SUBSTR( .cString, 4, 3)) && 23/12/04 County part of string lcStopNo = ALLTRIM( SUBSTR( .cString, 8, 8)) && Stop# part of string If lcCIFCCode <> lcPrevCIFCCode && No point re-seeking C Code if same as prev * 23/12/04 lcCountyCode = .lmLookUpCCode( lcStopNo, .cString) lcCountyCode = .lmLookUpCCode( lcStopNo, lcCIFCCode, lcRecID) && Look up County code lcPrevCIFCCode = lcCIFCCode EndIf * 07/12/04 Stop Nos. not unique across counties. If can't find the county code then can't store the * stop as Stop's primary key is now composite of Stop No. and County Code * _______________________________________________________________________ If Not EMPTY( lcCountyCode && Found look-up up equiv county code in County table lcStopCounty = PADR( lcStopNo, 8, " ") ; + PADR( lcCountyCode, 2, " ") && need seek on composite (mPlan-like) key ...