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