This program works out the key length of a Dictionary-IV format. It includes the format you enter, then uses ATR to add up the lengths of the data names flagged as keys.
00010 REM &REM&00020 PRINT 'CS'00030 INPUT @(0,5),"ENTER #FORMAT- ",FMT$! Enter format name include #00040 IF FMT$(1,1)<>"#" GOTO 30 ! If 1st char not # renenter00050 FORMAT INCLUDE #FMT$,OPT="NONE",ERR=200 ! Include format, if not, quit00060 ELEMS=NUM(ATR(FMT$,0,0)) ! Get number of datanames in format00070 KL=0 ! Set Key length to 000080 FOR E=1 TO ELEMS ! Loop thru format datanames00090 IF ATR(FMT$,E,17)="1" ! If dataname a key KL=KL+NUM(ATR(FMT$,E,1)) ! Add length to key length00100 NEXT E00110 PRINT "KEY LENGTH=",KL ! Print key length00120 GOTO 99900200 PRINT "Error ",ERR," occured while including format ",FMT$Notes
Enter the format name including the # sign, for example #UTCUST.