Listing: 1 MODULE AutoMix; (* Random changes *) 2 3 (* IMPORT PMD;*) 4 FROM SYSTEM IMPORT BYTE; 5 IMPORT InitCompilerMods; 6 IMPORT Locks; 7 FROM DBIndxes IMPORT DBIndex, InitIndex, CloseIndex, FindPositionCh, 8 AddToUpdateList; 9 FROM DBFields IMPORT Replace; 10 FROM ModBase3 IMPORT DBFile,InitDBF,OpenDBF,ReadDBRec,WriteDBRec, 11 NumberRecords,LockRec,UnLockRec,DefaultFixUp; 12 FROM ErrorManager IMPORT WARN; 13 FROM Timing IMPORT BeginTimer, ShowUsage; 14 15 FROM Rand IMPORT RandomInit, RandomCard,Randomize; 16 (* FROM Lib IMPORT RANDOM;*) 17 IMPORT StringIO; 18 IMPORT StrConv,FAPI; 19 VAR 20 counter:CARDINAL; 21 string:ARRAY[0..79] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 22 23 PROCEDURE KeyPressed():BOOLEAN; 24 VAR r:CARDINAL; 25 k:FAPI.KBDKEYINFO; ***** ^ not supported yet 26 BEGIN 27 k.chChar:=0C; ***** ^ not supported yet ***** ^ not supported yet 28 k.chScan:=0; ***** ^ not supported yet ***** ^ not supported yet 29 k.bNlsShift:=0; ***** ^ not supported yet ***** ^ not supported yet 30 r :=FAPI.KBDPEEK(ADR(k),0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 31 RETURN (k.chScan#BYTE(0)) OR (k.chChar#BYTE(0)); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 32 END KeyPressed; ***** ^ not supported yet 33 34 PROCEDURE RandStr(VAR S : ARRAY OF CHAR); ***** ^ not supported yet 35 (* Generate a string of random letters with a random length *) 36 VAR 37 I : CARDINAL; 38 Len : CARDINAL; 39 BEGIN 40 Len := 1 + (*RandomCard*)RandomCard(HIGH(S)+1) ; (* random 1 to 30 Len *) ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 41 FOR I := 0 TO Len - 1 DO 42 S[I] := CHR((*RandomCard*)RandomCard(26)+65); (* random letters *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 43 END (* for *); 44 FOR I := Len TO HIGH(S) DO (* ModBase requires space padded keys *) ***** ^ undeclared identifier ***** ^ not supported yet 45 S[I] := ' '; (* instead of a 0C terminated string *) ***** ^ not supported yet ***** ^ not supported yet 46 END (* if *); 47 END RandStr; ***** ^ not supported yet 48 49 CONST 50 KeyLen = 30; 51 Buffers = 400; 52 53 TYPE 54 KeyStr = ARRAY [0..KeyLen-1] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 55 56 VAR 57 DBF : DBFile; 58 NDX : DBIndex; 59 Name : KeyStr; ***** ^ not supported yet 60 Found : BOOLEAN; 61 rec:LONGINT; 62 res:CARDINAL; 63 BEGIN 64 Randomize; ***** ^ not supported yet 65 res:=FAPI.KBDFLUSHBUFFER(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 66 counter:=0; 67 InitDBF('Modbase.DBF',DBF,0,FALSE,FALSE,TRUE,DefaultFixUp); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 68 IF OpenDBF(DBF) THEN END; ***** ^ not supported yet ***** ^ not supported yet 69 InitIndex("ModBase.NDX", NDX,DBF, Buffers,FALSE,TRUE,FALSE); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 70 AddToUpdateList(DBF,NDX); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 71 REPEAT 72 (* rec:=VAL(LONGINT,RandomCard(VAL(CARDINAL,NumberRecords(DBF)))+1);*) 73 rec:=VAL(LONGINT,RandomCard(10)+1);(*increace odds of contention*) ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 74 RandStr(Name); ***** ^ not supported yet ***** ^ not supported yet 75 ReadDBRec(DBF,rec); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 76 Locks.Pause(200);(* give chance to others to change *) ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 77 Replace(DBF,1,Name); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 78 WriteDBRec(DBF); ***** ^ not supported yet ***** ^ not supported yet 79 StrConv.CardinalToStr(counter,8,string); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 80 StringIO.WriteStr(StringIO.outp,string); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 81 INC(counter); ***** ^ undeclared identifier ***** ^ not supported yet 82 UNTIL (counter=65000) OR KeyPressed(); (* until not in index *) ***** ^ not supported yet ***** ^ not supported yet 83 CloseIndex(NDX); ***** ^ not supported yet ***** ^ not supported yet 84 DEC(counter); ***** ^ undeclared identifier ***** ^ not supported yet 85 res:=FAPI.KBDFLUSHBUFFER(0); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 86 END AutoMix. 87 96 errors