ACCTEST.LST 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. Listing:
  2. 1
  3. 2 MODULE AccTest; (* Access Benchmark *)
  4. 3 IMPORT InitCompilerMods;
  5. 4 FROM DBIndxes IMPORT DBIndex, InitIndex, CloseIndex, FindPositionCh;
  6. 5 FROM ModBase3 IMPORT Replace,DBFile,InitDBF,OpenDBF,DefaultFixUp;
  7. 6
  8. 7 FROM Timing IMPORT BeginTimer, ShowUsage;
  9. 8
  10. 9 FROM Rand IMPORT RandomInit, RandomCard;
  11. 10 (* FROM Lib IMPORT RANDOM;*)
  12. 11 IMPORT StringIO;
  13. 12 IMPORT StrConv;
  14. 13 VAR
  15. 14 counter:CARDINAL;
  16. 15 string:ARRAY[0..79] OF CHAR;
  17. ***** ^ not supported yet
  18. ***** ^ not supported yet
  19. 16
  20. 17 PROCEDURE RandStr(VAR S : ARRAY OF CHAR);
  21. ***** ^ not supported yet
  22. 18 (* Generate a string of random letters with a random length *)
  23. 19 VAR
  24. 20 I : CARDINAL;
  25. 21 Len : CARDINAL;
  26. 22 BEGIN
  27. 23 Len := 1 + (*RandomCard*)RandomCard(HIGH(S)+1) ; (* random 1 to 30 Len *)
  28. ***** ^ not supported yet
  29. ***** ^ undeclared identifier
  30. ***** ^ not supported yet
  31. ***** ^ not supported yet
  32. 24 FOR I := 0 TO Len - 1 DO
  33. 25 S[I] := CHR((*RandomCard*)RandomCard(26)+65); (* random letters *)
  34. ***** ^ not supported yet
  35. ***** ^ not supported yet
  36. ***** ^ undeclared identifier
  37. ***** ^ not supported yet
  38. ***** ^ not supported yet
  39. ***** ^ not supported yet
  40. 26 END (* for *);
  41. 27 FOR I := Len TO HIGH(S) DO (* ModBase requires space padded keys *)
  42. ***** ^ undeclared identifier
  43. ***** ^ not supported yet
  44. 28 S[I] := ' '; (* instead of a 0C terminated string *)
  45. ***** ^ not supported yet
  46. ***** ^ not supported yet
  47. 29 END (* if *);
  48. 30 END RandStr;
  49. ***** ^ not supported yet
  50. 31
  51. 32 CONST
  52. 33 KeyLen = 30;
  53. 34 Buffers = 400;
  54. 35
  55. 36 TYPE
  56. 37 KeyStr = ARRAY [0..KeyLen-1] OF CHAR;
  57. ***** ^ not supported yet
  58. ***** ^ not supported yet
  59. 38
  60. 39 VAR
  61. 40 DBF : DBFile;
  62. 41 NDX : DBIndex;
  63. 42 Name : KeyStr;
  64. ***** ^ not supported yet
  65. 43 Found : BOOLEAN;
  66. 44
  67. 45 BEGIN
  68. 46 BeginTimer(); (* BeginTimer() timer counting *)
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. 47 RandomInit(1);
  72. ***** ^ not supported yet
  73. ***** ^ not supported yet
  74. 48 counter:=0;
  75. 49 InitDBF('Modbase.DBF',DBF,0,FALSE,TRUE,FALSE,DefaultFixUp);
  76. ***** ^ not supported yet
  77. ***** ^ not supported yet
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. 50 IF OpenDBF(DBF) THEN END;
  81. ***** ^ not supported yet
  82. ***** ^ not supported yet
  83. 51 InitIndex("ModBase.NDX", NDX,DBF, Buffers,FALSE,TRUE,TRUE);
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. ***** ^ not supported yet
  88. ***** ^ not supported yet
  89. 52 REPEAT (* generate random keys *)
  90. 53 RandStr(Name);
  91. ***** ^ not supported yet
  92. ***** ^ not supported yet
  93. 54 FindPositionCh(NDX, Name, Found);
  94. ***** ^ not supported yet
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. ***** ^ not supported yet
  98. 55 INC(counter);
  99. ***** ^ undeclared identifier
  100. ***** ^ not supported yet
  101. 56 UNTIL NOT Found; (* until not in index *)
  102. 57 CloseIndex(NDX);
  103. ***** ^ not supported yet
  104. ***** ^ not supported yet
  105. 58 DEC(counter);
  106. ***** ^ undeclared identifier
  107. ***** ^ not supported yet
  108. 59 StrConv.CardinalToStr(counter,0,string);
  109. ***** ^ not supported yet
  110. ***** ^ not supported yet
  111. ***** ^ not supported yet
  112. 60 StringIO.WriteStr(StringIO.outp,string);
  113. ***** ^ not supported yet
  114. ***** ^ not supported yet
  115. ***** ^ not supported yet
  116. ***** ^ not supported yet
  117. ***** ^ not supported yet
  118. 61 StringIO.WriteEol(StringIO.outp,' Keys found');
  119. ***** ^ not supported yet
  120. ***** ^ not supported yet
  121. ***** ^ not supported yet
  122. ***** ^ not supported yet
  123. ***** ^ not supported yet
  124. 62 ShowUsage(' Accsesstest time'); (* display elaped time in seconds *)
  125. ***** ^ not supported yet
  126. ***** ^ not supported yet
  127. 63 END AccTest.
  128. 64
  129. 63 errors