Bob Woodward" <[EMAIL PROTECTED]> wrote:
"As another option to try, write a program that uses the BASIC SELECT 
statement, not the TCL SELECT.  This way the program will step through the 
group, grabbing each record ID one by one.  After the READNEXT, test for a key 
length not equal zero.  This will handle a null key condition."

Bob you are correct that the TCL select, Edit, Delete will NOT always be able 
to delete certain keys with certain control characters in them.  And you are 
correct that the BASIC select is less restrictive.

Here is a snippet that should handle cases other than null.  This code will 
stop on any key that has 'unprintable' characters in it and ask if you want to 
delete it.  It will dsplay the key showing the hidden chars in decimal value.  
It also displays a running timer so you can tell that it's doing *something*.

REMOVE.RECORD.WITH.BAD.KEY
EQUATE FALSE TO 0, TRUE TO 1
OPEN "CUSTOMER" TO F.CUSTOMER ELSE PRINT "Cannot open."; STOP
SELECT F.CUSTOMER
DONE = FALSE; CNT = 0
LOOP
   READNEXT K.CUSTOMER ELSE DONE = TRUE
   IF NOT(MOD(CNT,250)) THEN PRINT CHAR(13):CNT"R#8":
UNTIL DONE DO
   CNT += 1
   IF K.CUSTOMER # OCONV(K.CUSTOMER,'MCP') THEN
      PRINT CHAR(13):CNT"R#8":
      L.CUSTOMER = LEN(K.CUSTOMER)
      FOR I = 1 TO L.CUSTOMER
         C.CUSTOMER = K.CUSTOMER[I,1]
         X.CUSTOMER = SEQ(C.CUSTOMER)
         IF X.CUSTOMER < 28 OR X.CUSTOMER > 127 THEN
            PRINT "X'":X.CUSTOMER:
         END ELSE PRINT C.CUSTOMER:
      NEXT I
      PRINT " DELETE Y/N ":; INPUT DELETEIT,1:_
      IF DELETEIT = "Y" THEN
         DELETE F.CUSTOMER,K.CUSTOMER
      END
   END
REPEAT
PRINT CHAR(13):CNT"R#8":" Records processed."

Will Johnson
Fast Forward Technologies
Member of the Establishing Board of the U2UG
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to