LPARAMETERS tnZoneNo LOCAL I, lnZLCount, lnZBCount, llEOList, lnLenZoneList * See how many times, if any, current zone no. appears both in the ZONELIST tables * and in a list of zone nos in current QO/I/T batch. * If it appears more in the batch than in zonelist then flag that it can be added - else that it can't * ___________ * 23/12/04 * Do While I < 111 ; && 23/12/04 With thisform Store 0 To lnZLCount, lnZBCount llEOList = .F. && ie not at end of list I = 1 lnLenZoneList = ALEN( .aZoneList, 1) && 23/12/04 * 23/12/04 * Do While I < 111 ; && 23/12/04 Do while I <= lnLenZoneList ; and not llEOList && tabs on ZONELIST rec If .aZoneList( I) = 0 *TPMcD* If EMPTY( .aZoneList( I)) llEOList = .T. Else If .aZoneList( I) = tnZoneNo *TPMcD* If ALLTRIM( .aZoneList( I)) == ALLTRIM( tcStopNo) lnZLCount = lnZLCount + 1 Endif I = I + 1 Endif EndDo llEOList = .F. && ie not at end of list I = 1 * 23/12/04 * Do While I < 111 ; && 23/12/04 Do while I <= lnLenZoneList ; and not llEOList && tabs on zones we're trying to add If .aZoneBatch( I) = 0 *TPMcD* If EMPTY( .aZoneBatch( I)) llEOList = .T. Else If .aZoneBatch( I) = tnZoneNo *TPMcD* If ALLTRIM( .aZoneBatch( I)) == ALLTRIM( tcStopNo) lnZBCount = lnZBCount + 1 Endif I = I + 1 Endif EndDo Endwith Return lnZBCount > lnZLCount && If more in inport list than already in ZONELIST can put in