* * * Find bad characters in a file ID or data * Tony Gravagno, Nebula Research and Development * http://Nebula-RnD.com * * Open Source v1.0 for D3 : 30 nov 2007 * * Please e-mail comments, enhancements, and other platform-specfic * versions to Freeware@Nebula-RnD.com. * * Updates may be available at http://Nebula-Rnd.com/freeware * * Responsibility for implementation and use of this program rests * entirely with the user. Nebula R&D will not be liable for any * time, data, financial, or other loss incurred as a result of * execution of this program. This software is distributed as-is * with no warranties or guarantees, explicit or implied. * * Please be sure to include comments for changes, note * conventions being used for Mod 1. * Author: Tony Gravagno (TG) * Contributors: xxxxxxxxxxxx * * Mod-000 TG 071130 Written * Mod-00n XX yymmdd text.... INPUT F OPEN F ELSE STOP 201,F SELECT CT = 0 LOOP READNEXT ID ELSE STOP CT+=1 * CRT CT:" ":ID ; * COMMENT THIS LINE TO AVOID SCROLLING ID'S REC1 = ID TYPE = "ID" GOSUB CHECK BAD = 0 READ REC0 FROM ID ELSE CRT "Can't read ID '":ID:"'" BAD = 1 END IF ID = "" THEN CRT "Null ID!" BAD = 1 END IF BAD THEN INPUT X REC0 = '' END REC1 = REC0 TYPE = "DATA" GOSUB CHECK UNTIL 0 DO REPEAT STOP CHECK: REC1 = SWAP(REC1,@AM,"{AM}") REC1 = SWAP(REC1,@VM,"]") REC1 = SWAP(REC1,@SM,"\") REC2 = OCONV(REC1,'MCP') IF REC1 # REC2 THEN CRT "BAD ":TYPE:" '":ID:"'" REC1 = SWAP(REC1,"{AM}",@AM) REC2 = SWAP(REC2,"{AM}",@AM) L1 = LEN(REC1) LAST.ATB = "" FOR P1 = 1 TO L1 IF REC1[P1,1] # REC2[P1,1] THEN IF TYPE # "ID" THEN THIS.ATB = DCOUNT(REC1[1,P1],@AM) IF THIS.ATB # LAST.ATB THEN CRT " atb ":THIS.ATB LAST.ATB = THIS.ATB END END LINE1 = REC1 LINE2 = REC2 L2 = LEN(LINE1) FOR P2 = 1 TO L2 IF LINE1[P2,1] # LINE2[P2,1] THEN CRT " ":P2'R#5':" '":LINE1[P2-4,9]:"'" * MOD-001 Don't need to see the period * CRT " '":LINE2[P2-4,9]:"'" END NEXT P2 P1 = INDEX(REC1,@AM,THIS.ATB) IF P1=0 THEN P1=L1 END NEXT P1 INPUT Z END RETURN END