DATEFUNC.LST 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. Listing:
  2. 1 IMPLEMENTATION MODULE DateFunctions;
  3. 2 (*
  4. 3 * REPERTOIRE
  5. 4 * Release 1.6
  6. 5 * By Charles Bradford and Cole Brecheen
  7. 6 * (c) Copyright 1985-1992 PMI
  8. 7 * Green Bay, WI
  9. 8 * All rights reserved
  10. 9 * (414) 468=6040
  11. 10 *
  12. 11 * $Header: D:/logfiles/mods/datefunc.mov 1.4 17 Mar 1991 17:53:06 coleb $
  13. 12 *
  14. 13 *)
  15. 14
  16. 15
  17. 16 (*EntryDiag:
  18. 17 IMPORT Diagnostics;
  19. 18 :EntryDiag*)
  20. 19
  21. 20 IMPORT M2Strings;
  22. 21 IMPORT PosUtils;
  23. 22 IMPORT StrConv;
  24. 23 IMPORT StrEdit;
  25. 24
  26. 25 VAR
  27. 26 Initialized : BOOLEAN;
  28. 27
  29. 28 TYPE
  30. 29 RepType = (DB, US, UK, USMilitary, Correspondence);
  31. 30
  32. 31
  33. 32 VAR
  34. 33 monthtotal: ARRAY [1..12] OF CARDINAL;
  35. ***** ^ not supported yet
  36. ***** ^ not supported yet
  37. 34 monthtotalleap : ARRAY[1..12] OF CARDINAL;
  38. ***** ^ not supported yet
  39. ***** ^ not supported yet
  40. 35 monthsize: ARRAY [1..12] OF CARDINAL;
  41. ***** ^ not supported yet
  42. ***** ^ not supported yet
  43. 36
  44. 37
  45. 38 PROCEDURE InitMonthTotal;
  46. 39 BEGIN
  47. 40 monthtotal[1] := 0; monthtotalleap[1] := 0;
  48. ***** ^ not supported yet
  49. ***** ^ not supported yet
  50. ***** ^ not supported yet
  51. ***** ^ not supported yet
  52. 41 monthtotal[2] := 31; monthtotalleap[2] := 31;
  53. ***** ^ not supported yet
  54. ***** ^ not supported yet
  55. ***** ^ not supported yet
  56. ***** ^ not supported yet
  57. 42 monthtotal[3] := 59; monthtotalleap[3] := 60;
  58. ***** ^ not supported yet
  59. ***** ^ not supported yet
  60. ***** ^ not supported yet
  61. ***** ^ not supported yet
  62. 43 monthtotal[4] := 90; monthtotalleap[4] := 91;
  63. ***** ^ not supported yet
  64. ***** ^ not supported yet
  65. ***** ^ not supported yet
  66. ***** ^ not supported yet
  67. 44 monthtotal[5] := 120; monthtotalleap[5] := 121;
  68. ***** ^ not supported yet
  69. ***** ^ not supported yet
  70. ***** ^ not supported yet
  71. ***** ^ not supported yet
  72. 45 monthtotal[6] := 151; monthtotalleap[6] := 152;
  73. ***** ^ not supported yet
  74. ***** ^ not supported yet
  75. ***** ^ not supported yet
  76. ***** ^ not supported yet
  77. 46 monthtotal[7] := 181; monthtotalleap[7] := 182;
  78. ***** ^ not supported yet
  79. ***** ^ not supported yet
  80. ***** ^ not supported yet
  81. ***** ^ not supported yet
  82. 47 monthtotal[8] := 212; monthtotalleap[8] := 213;
  83. ***** ^ not supported yet
  84. ***** ^ not supported yet
  85. ***** ^ not supported yet
  86. ***** ^ not supported yet
  87. 48 monthtotal[9] := 243; monthtotalleap[9] := 244;
  88. ***** ^ not supported yet
  89. ***** ^ not supported yet
  90. ***** ^ not supported yet
  91. ***** ^ not supported yet
  92. 49 monthtotal[10] := 273; monthtotalleap[10] := 274;
  93. ***** ^ not supported yet
  94. ***** ^ not supported yet
  95. ***** ^ not supported yet
  96. ***** ^ not supported yet
  97. 50 monthtotal[11] := 304; monthtotalleap[11] := 305;
  98. ***** ^ not supported yet
  99. ***** ^ not supported yet
  100. ***** ^ not supported yet
  101. ***** ^ not supported yet
  102. 51 monthtotal[12] := 334; monthtotalleap[12] := 335;
  103. ***** ^ not supported yet
  104. ***** ^ not supported yet
  105. ***** ^ not supported yet
  106. ***** ^ not supported yet
  107. 52 END InitMonthTotal;
  108. ***** ^ not supported yet
  109. 53
  110. 54 (*
  111. 55 PROCEDURE DateToStr2(d: Date; VAR s: ARRAY OF CHAR;
  112. 56 representation: RepType);
  113. 57 VAR daystr, mostr: ARRAY [0..1] OF CHAR;
  114. 58 yrstr: ARRAY [0..3] OF CHAR;
  115. 59
  116. 60 BEGIN
  117. 61 END DateToStr2;
  118. 62 *)
  119. 63
  120. 64
  121. 65 PROCEDURE DateToStr(d: Date; VAR s: ARRAY OF CHAR; VAR OK: BOOLEAN);
  122. ***** ^ undeclared identifier
  123. ***** ^ not supported yet
  124. 66
  125. 67 VAR i: CARDINAL;
  126. 68
  127. 69 PROCEDURE PutDigits(n: CARDINAL);
  128. 70 BEGIN
  129. 71 IF n < 10 THEN
  130. 72 s[i] := '0';
  131. ***** ^ not supported yet
  132. ***** ^ not supported yet
  133. 73 INC(i);
  134. ***** ^ undeclared identifier
  135. ***** ^ not supported yet
  136. 74 s[i] := CHR(n + 48);
  137. ***** ^ not supported yet
  138. ***** ^ not supported yet
  139. ***** ^ undeclared identifier
  140. ***** ^ not supported yet
  141. 75 INC(i);
  142. ***** ^ undeclared identifier
  143. ***** ^ not supported yet
  144. 76 ELSE
  145. 77 n := n MOD 100;
  146. 78 s[i] := CHR((n DIV 10) + 48);
  147. ***** ^ not supported yet
  148. ***** ^ not supported yet
  149. ***** ^ undeclared identifier
  150. ***** ^ not supported yet
  151. 79 INC(i);
  152. ***** ^ undeclared identifier
  153. ***** ^ not supported yet
  154. 80 s[i] := CHR((n MOD 10) + 48);
  155. ***** ^ not supported yet
  156. ***** ^ not supported yet
  157. ***** ^ undeclared identifier
  158. ***** ^ not supported yet
  159. 81 INC(i);
  160. ***** ^ undeclared identifier
  161. ***** ^ not supported yet
  162. 82 END;
  163. 83 END PutDigits;
  164. ***** ^ not supported yet
  165. 84
  166. 85 BEGIN
  167. 86 IF (HIGH(s) < 7) OR (NOT ValidDate(d))THEN
  168. ***** ^ undeclared identifier
  169. ***** ^ not supported yet
  170. ***** ^ undeclared identifier
  171. ***** ^ not supported yet
  172. 87 OK := FALSE;
  173. 88 FOR i := 0 TO HIGH(s) DO
  174. ***** ^ undeclared identifier
  175. ***** ^ not supported yet
  176. 89 s[i] := '*';
  177. ***** ^ not supported yet
  178. ***** ^ not supported yet
  179. 90 END;
  180. 91 ELSE
  181. 92 OK := TRUE;
  182. 93 i := 0;
  183. 94 PutDigits(d.mo);
  184. ***** ^ not supported yet
  185. ***** ^ not supported yet
  186. ***** ^ not supported yet
  187. 95 s[i] := '-';
  188. ***** ^ not supported yet
  189. ***** ^ not supported yet
  190. 96 INC(i);
  191. ***** ^ undeclared identifier
  192. ***** ^ not supported yet
  193. 97 PutDigits(d.day);
  194. ***** ^ not supported yet
  195. ***** ^ not supported yet
  196. ***** ^ not supported yet
  197. 98 s[i] := '-';
  198. ***** ^ not supported yet
  199. ***** ^ not supported yet
  200. 99 INC(i);
  201. ***** ^ undeclared identifier
  202. ***** ^ not supported yet
  203. 100 PutDigits(d.yr-1900);
  204. ***** ^ not supported yet
  205. ***** ^ not supported yet
  206. ***** ^ not supported yet
  207. ***** ^ not supported yet
  208. 101 IF HIGH(s) > 8 THEN
  209. ***** ^ undeclared identifier
  210. ***** ^ not supported yet
  211. 102 s[i] := 0C;
  212. ***** ^ not supported yet
  213. ***** ^ not supported yet
  214. 103 END;
  215. 104 END;
  216. 105 END DateToStr;
  217. ***** ^ not supported yet
  218. 106
  219. 107
  220. 108 PROCEDURE Digit(c : CHAR) : BOOLEAN;
  221. 109 BEGIN
  222. 110 RETURN (c>='0') AND (c<='9');
  223. 111 END Digit;
  224. ***** ^ not supported yet
  225. 112
  226. 113 PROCEDURE StrToDate(s: ARRAY OF CHAR; VAR d: Date; VAR OK: BOOLEAN);
  227. ***** ^ not supported yet
  228. ***** ^ undeclared identifier
  229. 114 (* expects mm dd yy *)
  230. 115 VAR i, yeardigits: CARDINAL;
  231. 116 BEGIN
  232. 117 i := 0;
  233. 118 WHILE (i <= HIGH(s)) AND (NOT Digit(s[i])) DO
  234. ***** ^ undeclared identifier
  235. ***** ^ not supported yet
  236. ***** ^ not supported yet
  237. ***** ^ not supported yet
  238. ***** ^ not supported yet
  239. 119 INC(i)
  240. ***** ^ undeclared identifier
  241. ***** ^ not supported yet
  242. 120 END;
  243. 121 d.mo := 0; d.yr := 0; d.day := 0;
  244. ***** ^ not supported yet
  245. ***** ^ not supported yet
  246. ***** ^ not supported yet
  247. ***** ^ not supported yet
  248. ***** ^ not supported yet
  249. ***** ^ not supported yet
  250. 122 WHILE (i <= HIGH(s)) AND (Digit(s[i])) DO
  251. ***** ^ undeclared identifier
  252. ***** ^ not supported yet
  253. ***** ^ not supported yet
  254. ***** ^ not supported yet
  255. ***** ^ not supported yet
  256. 123 d.mo := d.mo * 10 + (ORD(s[i])-48);
  257. ***** ^ not supported yet
  258. ***** ^ not supported yet
  259. ***** ^ not supported yet
  260. ***** ^ not supported yet
  261. ***** ^ undeclared identifier
  262. ***** ^ not supported yet
  263. ***** ^ not supported yet
  264. 124 INC(i);
  265. ***** ^ undeclared identifier
  266. ***** ^ not supported yet
  267. 125 END;
  268. 126 INC(i);
  269. ***** ^ undeclared identifier
  270. ***** ^ not supported yet
  271. 127 WHILE (i <= HIGH(s)) AND (Digit(s[i])) DO
  272. ***** ^ undeclared identifier
  273. ***** ^ not supported yet
  274. ***** ^ not supported yet
  275. ***** ^ not supported yet
  276. ***** ^ not supported yet
  277. 128 d.day := d.day * 10 + (ORD(s[i])-48);
  278. ***** ^ not supported yet
  279. ***** ^ not supported yet
  280. ***** ^ not supported yet
  281. ***** ^ not supported yet
  282. ***** ^ undeclared identifier
  283. ***** ^ not supported yet
  284. ***** ^ not supported yet
  285. 129 INC(i);
  286. ***** ^ undeclared identifier
  287. ***** ^ not supported yet
  288. 130 END;
  289. 131 INC(i);
  290. ***** ^ undeclared identifier
  291. ***** ^ not supported yet
  292. 132 yeardigits := 0;
  293. 133 WHILE (i <= HIGH(s)) AND (Digit(s[i])) DO
  294. ***** ^ undeclared identifier
  295. ***** ^ not supported yet
  296. ***** ^ not supported yet
  297. ***** ^ not supported yet
  298. ***** ^ not supported yet
  299. 134 d.yr := d.yr * 10 + (ORD(s[i])-48);
  300. ***** ^ not supported yet
  301. ***** ^ not supported yet
  302. ***** ^ not supported yet
  303. ***** ^ not supported yet
  304. ***** ^ undeclared identifier
  305. ***** ^ not supported yet
  306. ***** ^ not supported yet
  307. 135 INC(i);
  308. ***** ^ undeclared identifier
  309. ***** ^ not supported yet
  310. 136 INC(yeardigits);
  311. ***** ^ undeclared identifier
  312. ***** ^ not supported yet
  313. 137 END;
  314. 138 IF yeardigits <= 2 THEN
  315. 139 IF d.yr<40
  316. ***** ^ not supported yet
  317. ***** ^ not supported yet
  318. 140 THEN
  319. 141 INC(d.yr,2000);
  320. ***** ^ undeclared identifier
  321. ***** ^ not supported yet
  322. ***** ^ not supported yet
  323. ***** ^ not supported yet
  324. 142 ELSE
  325. 143 INC(d.yr, 1900);
  326. ***** ^ undeclared identifier
  327. ***** ^ not supported yet
  328. ***** ^ not supported yet
  329. ***** ^ not supported yet
  330. 144 END;
  331. 145 END;
  332. 146 IF NOT ValidDate(d) THEN
  333. ***** ^ undeclared identifier
  334. ***** ^ not supported yet
  335. 147 d.yr := 0; d.mo := 0; d.day := 0;
  336. ***** ^ not supported yet
  337. ***** ^ not supported yet
  338. ***** ^ not supported yet
  339. ***** ^ not supported yet
  340. ***** ^ not supported yet
  341. ***** ^ not supported yet
  342. 148 OK := FALSE
  343. 149 ELSE
  344. 150 OK := TRUE;
  345. 151 END;
  346. 152 END StrToDate;
  347. ***** ^ not supported yet
  348. 153
  349. 154
  350. 155 PROCEDURE StrToDate2( DateStr: ARRAY OF CHAR; EuropeanStyle: BOOLEAN;
  351. ***** ^ not supported yet
  352. 156 VAR day, month, year: CARDINAL ): BOOLEAN;
  353. 157 VAR
  354. 158 spot: CARDINAL;
  355. 159 separator: ARRAY [0..0] OF CHAR;
  356. ***** ^ not supported yet
  357. ***** ^ not supported yet
  358. 160 BEGIN
  359. 161 StrEdit.CrunchBlanks( DateStr );
  360. ***** ^ not supported yet
  361. ***** ^ not supported yet
  362. ***** ^ not supported yet
  363. 162 separator[0] := '/';
  364. ***** ^ not supported yet
  365. ***** ^ not supported yet
  366. 163 IF NOT PosUtils.PresentPos( separator, DateStr, spot ) THEN
  367. ***** ^ not supported yet
  368. ***** ^ not supported yet
  369. ***** ^ not supported yet
  370. ***** ^ not supported yet
  371. ***** ^ not supported yet
  372. 164 separator[0] := '-';
  373. ***** ^ not supported yet
  374. ***** ^ not supported yet
  375. 165 IF NOT PosUtils.PresentPos( separator, DateStr, spot ) THEN
  376. ***** ^ not supported yet
  377. ***** ^ not supported yet
  378. ***** ^ not supported yet
  379. ***** ^ not supported yet
  380. ***** ^ not supported yet
  381. 166 separator[0] := ':';
  382. ***** ^ not supported yet
  383. ***** ^ not supported yet
  384. 167 IF NOT PosUtils.PresentPos( separator, DateStr, spot ) THEN
  385. ***** ^ not supported yet
  386. ***** ^ not supported yet
  387. ***** ^ not supported yet
  388. ***** ^ not supported yet
  389. ***** ^ not supported yet
  390. 168 separator[0] := ' ';
  391. ***** ^ not supported yet
  392. ***** ^ not supported yet
  393. 169 IF NOT PosUtils.PresentPos( separator, DateStr, spot ) THEN
  394. ***** ^ not supported yet
  395. ***** ^ not supported yet
  396. ***** ^ not supported yet
  397. ***** ^ not supported yet
  398. ***** ^ not supported yet
  399. 170 RETURN FALSE;
  400. 171 END;
  401. 172 END;
  402. 173 END;
  403. 174 END;
  404. 175 IF NOT StrConv.StrToCardinal( DateStr, 0, day ) THEN
  405. ***** ^ not supported yet
  406. ***** ^ not supported yet
  407. ***** ^ not supported yet
  408. ***** ^ not supported yet
  409. 176 RETURN FALSE;
  410. 177 END;
  411. 178 IF NOT StrConv.StrToCardinal( DateStr, spot + 1, month ) THEN
  412. ***** ^ not supported yet
  413. ***** ^ not supported yet
  414. ***** ^ not supported yet
  415. ***** ^ not supported yet
  416. 179 RETURN FALSE;
  417. 180 END;
  418. 181 IF (month > 12) OR (NOT EuropeanStyle) THEN
  419. 182 (* use year as a temp to do swap *)
  420. 183 year := day;
  421. 184 day := month;
  422. 185 month := year;
  423. 186 END;
  424. 187 spot := PosUtils.Positn( separator, DateStr, spot + 1 );
  425. ***** ^ not supported yet
  426. ***** ^ not supported yet
  427. ***** ^ not supported yet
  428. ***** ^ not supported yet
  429. ***** ^ not supported yet
  430. 188 IF spot > HIGH(DateStr) THEN
  431. ***** ^ undeclared identifier
  432. ***** ^ not supported yet
  433. 189 RETURN FALSE;
  434. 190 END;
  435. 191 IF NOT StrConv.StrToCardinal( DateStr, spot + 1, year ) THEN
  436. ***** ^ not supported yet
  437. ***** ^ not supported yet
  438. ***** ^ not supported yet
  439. ***** ^ not supported yet
  440. 192 RETURN FALSE;
  441. 193 END;
  442. 194 RETURN TRUE;
  443. 195 END StrToDate2;
  444. ***** ^ not supported yet
  445. 196
  446. 197
  447. 198 PROCEDURE Day(d: Date): CARDINAL;
  448. ***** ^ undeclared identifier
  449. 199 BEGIN
  450. 200 IF ValidDate(d) THEN
  451. ***** ^ undeclared identifier
  452. ***** ^ not supported yet
  453. 201 RETURN d.day
  454. ***** ^ not supported yet
  455. ***** ^ not supported yet
  456. 202 ELSE
  457. 203 RETURN 0
  458. 204 END;
  459. 205 END Day;
  460. ***** ^ not supported yet
  461. 206
  462. 207
  463. 208 PROCEDURE LeapYear(year: CARDINAL): BOOLEAN;
  464. 209 BEGIN
  465. 210 RETURN ((year MOD 4 = 0) AND (year MOD 100 # 0)) OR (year MOD 400 = 0)
  466. 211 END LeapYear;
  467. ***** ^ not supported yet
  468. 212
  469. 213
  470. 214 PROCEDURE DayOfWeek(d: Date; VAR wkday: ARRAY OF CHAR);
  471. ***** ^ undeclared identifier
  472. ***** ^ not supported yet
  473. 215 VAR
  474. 216 daytable: ARRAY [1..12] OF CARDINAL;
  475. ***** ^ not supported yet
  476. ***** ^ not supported yet
  477. 217 centurytable: ARRAY [1..5] OF CARDINAL;
  478. ***** ^ not supported yet
  479. ***** ^ not supported yet
  480. 218 century, yearincent, result, i: CARDINAL;
  481. 219
  482. 220 PROCEDURE InitCent;
  483. 221 BEGIN
  484. 222 centurytable[1] := 1;
  485. ***** ^ not supported yet
  486. ***** ^ not supported yet
  487. 223 centurytable[2] := 2;
  488. ***** ^ not supported yet
  489. ***** ^ not supported yet
  490. 224 centurytable[3] := 0;
  491. ***** ^ not supported yet
  492. ***** ^ not supported yet
  493. 225 centurytable[4] := 6;
  494. ***** ^ not supported yet
  495. ***** ^ not supported yet
  496. 226 centurytable[5] := 4;
  497. ***** ^ not supported yet
  498. ***** ^ not supported yet
  499. 227 END InitCent;
  500. ***** ^ not supported yet
  501. 228
  502. 229 PROCEDURE InitDayTable;
  503. 230 BEGIN
  504. 231 daytable[1] := 0;
  505. ***** ^ not supported yet
  506. ***** ^ not supported yet
  507. 232 daytable[2] := 3;
  508. ***** ^ not supported yet
  509. ***** ^ not supported yet
  510. 233 daytable[3] := 3;
  511. ***** ^ not supported yet
  512. ***** ^ not supported yet
  513. 234 daytable[4] := 6;
  514. ***** ^ not supported yet
  515. ***** ^ not supported yet
  516. 235 daytable[5] := 1;
  517. ***** ^ not supported yet
  518. ***** ^ not supported yet
  519. 236 daytable[6] := 4;
  520. ***** ^ not supported yet
  521. ***** ^ not supported yet
  522. 237 daytable[7] := 6;
  523. ***** ^ not supported yet
  524. ***** ^ not supported yet
  525. 238 daytable[8] := 2;
  526. ***** ^ not supported yet
  527. ***** ^ not supported yet
  528. 239 daytable[9] := 5;
  529. ***** ^ not supported yet
  530. ***** ^ not supported yet
  531. 240 daytable[10] := 0;
  532. ***** ^ not supported yet
  533. ***** ^ not supported yet
  534. 241 daytable[11] := 3;
  535. ***** ^ not supported yet
  536. ***** ^ not supported yet
  537. 242 daytable[12] := 5;
  538. ***** ^ not supported yet
  539. ***** ^ not supported yet
  540. 243 END InitDayTable;
  541. ***** ^ not supported yet
  542. 244
  543. 245 BEGIN
  544. 246 IF ValidDate(d) THEN
  545. ***** ^ undeclared identifier
  546. ***** ^ not supported yet
  547. 247 InitDayTable;
  548. ***** ^ not supported yet
  549. 248 InitCent;
  550. ***** ^ not supported yet
  551. 249 IF LeapYear(d.yr) THEN
  552. ***** ^ not supported yet
  553. ***** ^ not supported yet
  554. ***** ^ not supported yet
  555. 250 daytable[1] := 6;
  556. ***** ^ not supported yet
  557. ***** ^ not supported yet
  558. 251 daytable[2] := 2;
  559. ***** ^ not supported yet
  560. ***** ^ not supported yet
  561. 252 END;
  562. 253 century := d.yr DIV 100;
  563. ***** ^ not supported yet
  564. ***** ^ not supported yet
  565. 254 yearincent := d.yr - century*100;
  566. ***** ^ not supported yet
  567. ***** ^ not supported yet
  568. 255 result := centurytable[century-16] + yearincent +
  569. ***** ^ not supported yet
  570. ***** ^ not supported yet
  571. 256 (yearincent DIV 4) + daytable[d.mo] + d.day;
  572. ***** ^ not supported yet
  573. ***** ^ not supported yet
  574. ***** ^ not supported yet
  575. ***** ^ not supported yet
  576. ***** ^ not supported yet
  577. 257 (* NOTE!!! the above configuration is only likely to be accurate
  578. 258 for 20th & 21st century *)
  579. 259 CASE result MOD 7 OF
  580. 260 0: M2Strings.Copy("Sunday", 0, HIGH(wkday), wkday);
  581. ***** ^ not supported yet
  582. ***** ^ not supported yet
  583. ***** ^ not supported yet
  584. ***** ^ undeclared identifier
  585. ***** ^ not supported yet
  586. ***** ^ not supported yet
  587. 261 | 1: M2Strings.Copy("Monday", 0, HIGH(wkday), wkday);
  588. ***** ^ not supported yet
  589. ***** ^ not supported yet
  590. ***** ^ not supported yet
  591. ***** ^ undeclared identifier
  592. ***** ^ not supported yet
  593. ***** ^ not supported yet
  594. 262 | 2: M2Strings.Copy("Tuesday", 0, HIGH(wkday), wkday);
  595. ***** ^ not supported yet
  596. ***** ^ not supported yet
  597. ***** ^ not supported yet
  598. ***** ^ undeclared identifier
  599. ***** ^ not supported yet
  600. ***** ^ not supported yet
  601. 263 | 3: M2Strings.Copy("Wednesday", 0, HIGH(wkday), wkday);
  602. ***** ^ not supported yet
  603. ***** ^ not supported yet
  604. ***** ^ not supported yet
  605. ***** ^ undeclared identifier
  606. ***** ^ not supported yet
  607. ***** ^ not supported yet
  608. 264 | 4: M2Strings.Copy("Thursday", 0, HIGH(wkday), wkday);
  609. ***** ^ not supported yet
  610. ***** ^ not supported yet
  611. ***** ^ not supported yet
  612. ***** ^ undeclared identifier
  613. ***** ^ not supported yet
  614. ***** ^ not supported yet
  615. 265 | 5: M2Strings.Copy("Friday", 0, HIGH(wkday), wkday);
  616. ***** ^ not supported yet
  617. ***** ^ not supported yet
  618. ***** ^ not supported yet
  619. ***** ^ undeclared identifier
  620. ***** ^ not supported yet
  621. ***** ^ not supported yet
  622. 266 | 6: M2Strings.Copy("Saturday", 0, HIGH(wkday), wkday);
  623. ***** ^ not supported yet
  624. ***** ^ not supported yet
  625. ***** ^ not supported yet
  626. ***** ^ undeclared identifier
  627. ***** ^ not supported yet
  628. ***** ^ not supported yet
  629. 267 END; (* case*)
  630. 268 ELSE
  631. 269 FOR i := 0 TO HIGH(wkday) DO
  632. ***** ^ undeclared identifier
  633. ***** ^ not supported yet
  634. 270 wkday[i] := '*'
  635. ***** ^ not supported yet
  636. ***** ^ not supported yet
  637. 271 END;
  638. 272 END;
  639. 273 END DayOfWeek;
  640. ***** ^ not supported yet
  641. 274
  642. 275 PROCEDURE Month(d: Date): CARDINAL;
  643. ***** ^ undeclared identifier
  644. 276 BEGIN
  645. 277 IF ValidDate(d) THEN
  646. ***** ^ undeclared identifier
  647. ***** ^ not supported yet
  648. 278 RETURN d.mo
  649. ***** ^ not supported yet
  650. ***** ^ not supported yet
  651. 279 ELSE
  652. 280 RETURN 0
  653. 281 END;
  654. 282 END Month;
  655. ***** ^ not supported yet
  656. 283
  657. 284 PROCEDURE CalendarMonth(d: Date; VAR cmonth: ARRAY OF CHAR);
  658. ***** ^ undeclared identifier
  659. ***** ^ not supported yet
  660. 285 BEGIN
  661. 286 IF ValidDate(d) THEN
  662. ***** ^ undeclared identifier
  663. ***** ^ not supported yet
  664. 287 CASE d.mo OF
  665. ***** ^ not supported yet
  666. ***** ^ not supported yet
  667. 288 1: M2Strings.Copy('January', 0, 9, cmonth);
  668. ***** ^ not supported yet
  669. ***** ^ not supported yet
  670. ***** ^ not supported yet
  671. ***** ^ not supported yet
  672. 289 | 2: M2Strings.Copy('February', 0, 9, cmonth);
  673. ***** ^ not supported yet
  674. ***** ^ not supported yet
  675. ***** ^ not supported yet
  676. ***** ^ not supported yet
  677. 290 | 3: M2Strings.Copy('March', 0, 9, cmonth);
  678. ***** ^ not supported yet
  679. ***** ^ not supported yet
  680. ***** ^ not supported yet
  681. ***** ^ not supported yet
  682. 291 | 4: M2Strings.Copy('April', 0, 9, cmonth);
  683. ***** ^ not supported yet
  684. ***** ^ not supported yet
  685. ***** ^ not supported yet
  686. ***** ^ not supported yet
  687. 292 | 5: M2Strings.Copy('May', 0, 9, cmonth);
  688. ***** ^ not supported yet
  689. ***** ^ not supported yet
  690. ***** ^ not supported yet
  691. ***** ^ not supported yet
  692. 293 | 6: M2Strings.Copy('June', 0, 9, cmonth);
  693. ***** ^ not supported yet
  694. ***** ^ not supported yet
  695. ***** ^ not supported yet
  696. ***** ^ not supported yet
  697. 294 | 7: M2Strings.Copy('July', 0, 9, cmonth);
  698. ***** ^ not supported yet
  699. ***** ^ not supported yet
  700. ***** ^ not supported yet
  701. ***** ^ not supported yet
  702. 295 | 8: M2Strings.Copy('August', 0, 9, cmonth);
  703. ***** ^ not supported yet
  704. ***** ^ not supported yet
  705. ***** ^ not supported yet
  706. ***** ^ not supported yet
  707. 296 | 9: M2Strings.Copy('September', 0, 9, cmonth);
  708. ***** ^ not supported yet
  709. ***** ^ not supported yet
  710. ***** ^ not supported yet
  711. ***** ^ not supported yet
  712. 297 | 10: M2Strings.Copy('October', 0, 9, cmonth);
  713. ***** ^ not supported yet
  714. ***** ^ not supported yet
  715. ***** ^ not supported yet
  716. ***** ^ not supported yet
  717. 298 | 11: M2Strings.Copy('November', 0, 9, cmonth);
  718. ***** ^ not supported yet
  719. ***** ^ not supported yet
  720. ***** ^ not supported yet
  721. ***** ^ not supported yet
  722. 299 | 12: M2Strings.Copy('December', 0, 9, cmonth);
  723. ***** ^ not supported yet
  724. ***** ^ not supported yet
  725. ***** ^ not supported yet
  726. ***** ^ not supported yet
  727. 300 END; (* case *)
  728. 301 ELSE
  729. 302 M2Strings.Copy('********',0, 8, cmonth);
  730. ***** ^ not supported yet
  731. ***** ^ not supported yet
  732. ***** ^ not supported yet
  733. ***** ^ not supported yet
  734. 303 END;
  735. 304 END CalendarMonth;
  736. ***** ^ not supported yet
  737. 305
  738. 306
  739. 307 PROCEDURE Year(d: Date): CARDINAL;
  740. ***** ^ undeclared identifier
  741. 308 BEGIN
  742. 309 IF ValidDate(d) THEN
  743. ***** ^ undeclared identifier
  744. ***** ^ not supported yet
  745. 310 RETURN (d.yr)
  746. ***** ^ not supported yet
  747. ***** ^ not supported yet
  748. 311 ELSE
  749. 312 RETURN 0
  750. 313 END;
  751. 314 END Year;
  752. ***** ^ not supported yet
  753. 315
  754. 316
  755. 317 PROCEDURE DateToWritten(d: Date; VAR written: ARRAY OF CHAR);
  756. ***** ^ undeclared identifier
  757. ***** ^ not supported yet
  758. 318 VAR
  759. 319 temp: ARRAY [0..4] OF CHAR;
  760. ***** ^ not supported yet
  761. ***** ^ not supported yet
  762. 320 BEGIN
  763. 321 CalendarMonth(d, written);
  764. ***** ^ not supported yet
  765. ***** ^ not supported yet
  766. ***** ^ not supported yet
  767. 322 M2Strings.Concat(written, ' ', written);
  768. ***** ^ not supported yet
  769. ***** ^ not supported yet
  770. ***** ^ not supported yet
  771. ***** ^ not supported yet
  772. 323 StrConv.CardinalToStr(d.day, 0, temp);
  773. ***** ^ not supported yet
  774. ***** ^ not supported yet
  775. ***** ^ not supported yet
  776. ***** ^ not supported yet
  777. ***** ^ not supported yet
  778. 324 M2Strings.Concat(written, temp, written);
  779. ***** ^ not supported yet
  780. ***** ^ not supported yet
  781. ***** ^ not supported yet
  782. ***** ^ not supported yet
  783. ***** ^ not supported yet
  784. 325 M2Strings.Concat(written, ', ', written);
  785. ***** ^ not supported yet
  786. ***** ^ not supported yet
  787. ***** ^ not supported yet
  788. ***** ^ not supported yet
  789. ***** ^ not supported yet
  790. 326 StrConv.CardinalToStr(d.yr, 0, temp);
  791. ***** ^ not supported yet
  792. ***** ^ not supported yet
  793. ***** ^ not supported yet
  794. ***** ^ not supported yet
  795. ***** ^ not supported yet
  796. 327 M2Strings.Concat(written, temp, written);
  797. ***** ^ not supported yet
  798. ***** ^ not supported yet
  799. ***** ^ not supported yet
  800. ***** ^ not supported yet
  801. ***** ^ not supported yet
  802. 328 END DateToWritten;
  803. ***** ^ not supported yet
  804. 329
  805. 330
  806. 331 PROCEDURE DatePlusDays(VAR d: Date; days: CARDINAL; VAR OK: BOOLEAN);
  807. ***** ^ undeclared identifier
  808. 332 BEGIN
  809. 333 IF NOT ValidDate(d) THEN
  810. ***** ^ undeclared identifier
  811. ***** ^ not supported yet
  812. 334 WITH d DO
  813. ***** ^ not supported yet
  814. 335 yr := 0;
  815. ***** ^ undeclared identifier
  816. 336 mo := 0;
  817. ***** ^ undeclared identifier
  818. 337 day := 0;
  819. ***** ^ undeclared identifier
  820. 338 END;
  821. ***** ^ not supported yet
  822. 339 OK := FALSE
  823. ***** ^ undeclared identifier
  824. 340 ELSE
  825. 341 CardToDate(DaysSince1900(d) + days, d);
  826. ***** ^ undeclared identifier
  827. ***** ^ undeclared identifier
  828. ***** ^ undeclared identifier
  829. ***** ^ undeclared identifier
  830. ***** ^ undeclared identifier
  831. 342 OK := TRUE
  832. ***** ^ undeclared identifier
  833. 343 END;
  834. 344 END DatePlusDays;
  835. ***** ^ not supported yet
  836. 345
  837. 346
  838. 347 PROCEDURE InitMonths;
  839. 348 BEGIN
  840. 349 monthsize[1] := 31;
  841. ***** ^ not supported yet
  842. ***** ^ not supported yet
  843. 350 monthsize[2] := 28;
  844. ***** ^ not supported yet
  845. ***** ^ not supported yet
  846. 351 monthsize[3] := 31;
  847. ***** ^ not supported yet
  848. ***** ^ not supported yet
  849. 352 monthsize[4] := 30;
  850. ***** ^ not supported yet
  851. ***** ^ not supported yet
  852. 353 monthsize[5] := 31;
  853. ***** ^ not supported yet
  854. ***** ^ not supported yet
  855. 354 monthsize[6] := 30;
  856. ***** ^ not supported yet
  857. ***** ^ not supported yet
  858. 355 monthsize[7] := 31;
  859. ***** ^ not supported yet
  860. ***** ^ not supported yet
  861. 356 monthsize[8] := 31;
  862. ***** ^ not supported yet
  863. ***** ^ not supported yet
  864. 357 monthsize[9] := 30;
  865. ***** ^ not supported yet
  866. ***** ^ not supported yet
  867. 358 monthsize[10] := 31;
  868. ***** ^ not supported yet
  869. ***** ^ not supported yet
  870. 359 monthsize[11] := 30;
  871. ***** ^ not supported yet
  872. ***** ^ not supported yet
  873. 360 monthsize[12] := 31;
  874. ***** ^ not supported yet
  875. ***** ^ not supported yet
  876. 361 END InitMonths;
  877. ***** ^ not supported yet
  878. 362
  879. 363
  880. 364 PROCEDURE ValidDate(d: Date): BOOLEAN;
  881. ***** ^ undeclared identifier
  882. 365
  883. 366 BEGIN
  884. 367 IF LeapYear(d.yr)THEN
  885. ***** ^ not supported yet
  886. ***** ^ not supported yet
  887. ***** ^ not supported yet
  888. 368 monthsize[2] := 29;
  889. ***** ^ not supported yet
  890. ***** ^ not supported yet
  891. 369 ELSE
  892. 370 monthsize[2] := 28;
  893. ***** ^ not supported yet
  894. ***** ^ not supported yet
  895. 371 END;
  896. 372 RETURN((d.mo >= 1) AND (d.mo <= 12)) AND
  897. ***** ^ not supported yet
  898. ***** ^ not supported yet
  899. ***** ^ not supported yet
  900. ***** ^ not supported yet
  901. 373 ((d.day >=1) AND (d.day <= monthsize[d.mo])) AND
  902. ***** ^ not supported yet
  903. ***** ^ not supported yet
  904. ***** ^ not supported yet
  905. ***** ^ not supported yet
  906. ***** ^ not supported yet
  907. ***** ^ not supported yet
  908. ***** ^ not supported yet
  909. 374 ((d.yr >= MinYear) AND (d.yr <= MaxYear));
  910. ***** ^ not supported yet
  911. ***** ^ not supported yet
  912. ***** ^ undeclared identifier
  913. ***** ^ not supported yet
  914. ***** ^ not supported yet
  915. ***** ^ undeclared identifier
  916. 375 END ValidDate;
  917. ***** ^ not supported yet
  918. 376
  919. 377
  920. 378 PROCEDURE DaysSince1900(d: Date): CARDINAL;
  921. ***** ^ undeclared identifier
  922. 379 VAR
  923. 380 yearsSince, leapYearsSince, result: CARDINAL;
  924. 381 BEGIN
  925. 382 IF ValidDate(d) THEN
  926. ***** ^ not supported yet
  927. ***** ^ not supported yet
  928. 383 yearsSince := (d.yr - 1900) * 365;
  929. ***** ^ not supported yet
  930. ***** ^ not supported yet
  931. 384 result:=d.yr-1900;
  932. ***** ^ not supported yet
  933. ***** ^ not supported yet
  934. 385 IF result>1 THEN DEC(result) END;
  935. ***** ^ undeclared identifier
  936. ***** ^ not supported yet
  937. 386 leapYearsSince := (result) DIV 4;
  938. 387 result := yearsSince + leapYearsSince + DayOfYear(d)-1;
  939. ***** ^ undeclared identifier
  940. ***** ^ not supported yet
  941. 388 (* IF LeapYear(d.yr) AND (d.mo > 2) THEN
  942. 389 INC( result );
  943. 390 END; *)
  944. 391 RETURN result
  945. 392 ELSE
  946. 393 RETURN 0
  947. 394 END;
  948. 395 END DaysSince1900;
  949. ***** ^ not supported yet
  950. 396
  951. 397
  952. 398 PROCEDURE DayOfYear(d:Date): CARDINAL;
  953. ***** ^ undeclared identifier
  954. 399 (* Returns 0 if the date is not Valid *)
  955. 400 VAR julian: CARDINAL;
  956. 401
  957. 402 BEGIN
  958. 403 IF ValidDate(d) THEN
  959. ***** ^ not supported yet
  960. ***** ^ not supported yet
  961. 404 IF LeapYear(d.yr) AND (d.mo > 2) THEN
  962. ***** ^ not supported yet
  963. ***** ^ not supported yet
  964. ***** ^ not supported yet
  965. ***** ^ not supported yet
  966. ***** ^ not supported yet
  967. 405 julian := monthtotalleap[d.mo] + d.day;
  968. ***** ^ not supported yet
  969. ***** ^ not supported yet
  970. ***** ^ not supported yet
  971. ***** ^ not supported yet
  972. ***** ^ not supported yet
  973. 406 ELSE
  974. 407 julian := monthtotal[d.mo] + d.day;
  975. ***** ^ not supported yet
  976. ***** ^ not supported yet
  977. ***** ^ not supported yet
  978. ***** ^ not supported yet
  979. ***** ^ not supported yet
  980. 408 END;
  981. 409 RETURN julian
  982. 410 ELSE
  983. 411 RETURN 0
  984. 412 END;
  985. 413 END DayOfYear;
  986. ***** ^ not supported yet
  987. 414
  988. 415 PROCEDURE CardToDate(n: CARDINAL; VAR d: Date);
  989. ***** ^ undeclared identifier
  990. 416 VAR julday,
  991. 417 c,LeapYears: CARDINAL;
  992. 418 BEGIN
  993. 419 d.yr := n DIV 365;
  994. ***** ^ not supported yet
  995. ***** ^ not supported yet
  996. 420 julday:= n MOD 365+1;
  997. 421 c:=d.yr;
  998. ***** ^ not supported yet
  999. ***** ^ not supported yet
  1000. 422 IF c >1 THEN DEC(c) END;
  1001. ***** ^ undeclared identifier
  1002. ***** ^ not supported yet
  1003. 423 LeapYears:= c DIV 4;(* leap years is to count preceding not current *)
  1004. 424 IF (julday > LeapYears) THEN
  1005. 425 DEC(julday,LeapYears)
  1006. ***** ^ undeclared identifier
  1007. ***** ^ not supported yet
  1008. 426 ELSE
  1009. 427 julday:=julday+365-LeapYears;
  1010. 428 DEC(d.yr);
  1011. ***** ^ undeclared identifier
  1012. ***** ^ not supported yet
  1013. ***** ^ not supported yet
  1014. 429 IF( d.yr#0) AND ((d.yr MOD 4) =0)
  1015. ***** ^ not supported yet
  1016. ***** ^ not supported yet
  1017. ***** ^ not supported yet
  1018. ***** ^ not supported yet
  1019. 430 THEN
  1020. 431 INC(julday);(* do not want to count leap day twice *)
  1021. ***** ^ undeclared identifier
  1022. ***** ^ not supported yet
  1023. 432 END;
  1024. 433 END;
  1025. 434 d.yr := d.yr + 1900;
  1026. ***** ^ not supported yet
  1027. ***** ^ not supported yet
  1028. ***** ^ not supported yet
  1029. ***** ^ not supported yet
  1030. 435 d.mo := 0;
  1031. ***** ^ not supported yet
  1032. ***** ^ not supported yet
  1033. 436 d.day := 0;
  1034. ***** ^ not supported yet
  1035. ***** ^ not supported yet
  1036. 437 IF NOT LeapYear(d.yr) THEN
  1037. ***** ^ not supported yet
  1038. ***** ^ not supported yet
  1039. ***** ^ not supported yet
  1040. 438 (* DEC (julday);*)
  1041. 439 REPEAT
  1042. 440 INC(d.mo)
  1043. ***** ^ undeclared identifier
  1044. ***** ^ not supported yet
  1045. ***** ^ not supported yet
  1046. 441 UNTIL (d.mo = 12) OR (julday <= monthtotal[d.mo + 1]);
  1047. ***** ^ not supported yet
  1048. ***** ^ not supported yet
  1049. ***** ^ not supported yet
  1050. ***** ^ not supported yet
  1051. ***** ^ not supported yet
  1052. ***** ^ not supported yet
  1053. 442 d.day := julday - monthtotal[d.mo];
  1054. ***** ^ not supported yet
  1055. ***** ^ not supported yet
  1056. ***** ^ not supported yet
  1057. ***** ^ not supported yet
  1058. ***** ^ not supported yet
  1059. 443 ELSE
  1060. 444 REPEAT
  1061. 445 INC(d.mo)
  1062. ***** ^ undeclared identifier
  1063. ***** ^ not supported yet
  1064. ***** ^ not supported yet
  1065. 446 UNTIL (d.mo = 12) OR (julday <= monthtotalleap[d.mo + 1]);
  1066. ***** ^ not supported yet
  1067. ***** ^ not supported yet
  1068. ***** ^ not supported yet
  1069. ***** ^ not supported yet
  1070. ***** ^ not supported yet
  1071. ***** ^ not supported yet
  1072. 447 (* note: can't just add 1 -- it throws January off!! *)
  1073. 448 d.day := julday - (monthtotalleap[d.mo]);
  1074. ***** ^ not supported yet
  1075. ***** ^ not supported yet
  1076. ***** ^ not supported yet
  1077. ***** ^ not supported yet
  1078. ***** ^ not supported yet
  1079. 449 END;
  1080. 450 END CardToDate;
  1081. ***** ^ not supported yet
  1082. 451
  1083. 452
  1084. 453 PROCEDURE CompareDates(d1, d2: Date): Comparison;
  1085. ***** ^ undeclared identifier
  1086. ***** ^ undeclared identifier
  1087. 454 BEGIN
  1088. 455 IF d1.yr > d2.yr THEN
  1089. ***** ^ not supported yet
  1090. ***** ^ not supported yet
  1091. ***** ^ not supported yet
  1092. ***** ^ not supported yet
  1093. 456 RETURN DateGreater
  1094. ***** ^ undeclared identifier
  1095. 457 ELSIF d1.yr < d2.yr THEN
  1096. ***** ^ not supported yet
  1097. ***** ^ not supported yet
  1098. ***** ^ not supported yet
  1099. ***** ^ not supported yet
  1100. 458 RETURN DateLess
  1101. ***** ^ undeclared identifier
  1102. 459 ELSE
  1103. 460 IF d1.mo > d2.mo THEN
  1104. ***** ^ not supported yet
  1105. ***** ^ not supported yet
  1106. ***** ^ not supported yet
  1107. ***** ^ not supported yet
  1108. 461 RETURN DateGreater
  1109. ***** ^ undeclared identifier
  1110. 462 ELSIF d1.mo < d2.mo THEN
  1111. ***** ^ not supported yet
  1112. ***** ^ not supported yet
  1113. ***** ^ not supported yet
  1114. ***** ^ not supported yet
  1115. 463 RETURN DateLess
  1116. ***** ^ undeclared identifier
  1117. 464 ELSE
  1118. 465 IF d1.day > d2.day THEN
  1119. ***** ^ not supported yet
  1120. ***** ^ not supported yet
  1121. ***** ^ not supported yet
  1122. ***** ^ not supported yet
  1123. 466 RETURN DateGreater
  1124. ***** ^ undeclared identifier
  1125. 467 ELSIF d1.day < d2.day THEN
  1126. ***** ^ not supported yet
  1127. ***** ^ not supported yet
  1128. ***** ^ not supported yet
  1129. ***** ^ not supported yet
  1130. 468 RETURN DateLess
  1131. ***** ^ undeclared identifier
  1132. 469 ELSE
  1133. 470 RETURN DateEqual
  1134. ***** ^ undeclared identifier
  1135. 471 END;
  1136. 472 END;
  1137. 473 END;
  1138. 474 RETURN DateEqual;
  1139. ***** ^ undeclared identifier
  1140. 475 END CompareDates;
  1141. ***** ^ not supported yet
  1142. 476
  1143. 477
  1144. 478 PROCEDURE DateDiff(d1, d2: Date): CARDINAL;
  1145. ***** ^ undeclared identifier
  1146. 479 BEGIN
  1147. 480 IF CompareDates(d1, d2) = DateGreater THEN
  1148. ***** ^ not supported yet
  1149. ***** ^ not supported yet
  1150. ***** ^ not supported yet
  1151. ***** ^ undeclared identifier
  1152. 481 RETURN(DaysSince1900(d1) - DaysSince1900(d2))
  1153. ***** ^ not supported yet
  1154. ***** ^ not supported yet
  1155. ***** ^ not supported yet
  1156. ***** ^ not supported yet
  1157. 482 ELSE
  1158. 483 RETURN(DaysSince1900(d2) - DaysSince1900(d1))
  1159. ***** ^ not supported yet
  1160. ***** ^ not supported yet
  1161. ***** ^ not supported yet
  1162. ***** ^ not supported yet
  1163. 484 END;
  1164. 485 END DateDiff;
  1165. ***** ^ not supported yet
  1166. 486
  1167. 487
  1168. 488 PROCEDURE Init();
  1169. 489 BEGIN
  1170. 490 IF Initialized THEN
  1171. 491 RETURN;
  1172. 492 ELSE
  1173. 493 Initialized := TRUE;
  1174. 494 END;
  1175. 495 (*EntryDiag:
  1176. 496 Diagnostics.Init();
  1177. 497 :EntryDiag*)
  1178. 498 M2Strings.Init();
  1179. ***** ^ not supported yet
  1180. ***** ^ not supported yet
  1181. ***** ^ not supported yet
  1182. 499 PosUtils.Init();
  1183. ***** ^ not supported yet
  1184. ***** ^ not supported yet
  1185. ***** ^ not supported yet
  1186. 500 StrConv.Init();
  1187. ***** ^ not supported yet
  1188. ***** ^ not supported yet
  1189. ***** ^ not supported yet
  1190. 501 StrEdit.Init();
  1191. ***** ^ not supported yet
  1192. ***** ^ not supported yet
  1193. ***** ^ not supported yet
  1194. 502 (*EntryDiag:
  1195. 503 Diagnostics.diagS( 'Entering DateFunctions', '' );
  1196. 504 :EntryDiag*)
  1197. 505
  1198. 506 InitMonthTotal();
  1199. ***** ^ not supported yet
  1200. ***** ^ not supported yet
  1201. 507 InitMonths();
  1202. ***** ^ not supported yet
  1203. ***** ^ not supported yet
  1204. 508
  1205. 509 (*EntryDiag:
  1206. 510 Diagnostics.diagS( 'Exiting DateFunctions', '' );
  1207. 511 :EntryDiag*)
  1208. 512 END Init;
  1209. ***** ^ not supported yet
  1210. 513
  1211. 514
  1212. 515 BEGIN
  1213. 516 Initialized := FALSE;
  1214. 517 Init();
  1215. ***** ^ not supported yet
  1216. ***** ^ not supported yet
  1217. 518 END DateFunctions.
  1218. ***** ^ not supported yet
  1219. 699 errors