Listing: 1 IMPLEMENTATION MODULE StrConv; 2 (* 3 * REPERTOIRE 4 * Release 1.6 5 * By Charles Bradford and Cole Brecheen 6 * (c) Copyright 1985-1992 PMI 7 * Green Bay, Wisconsin 8 * All rights reserved 9 * (414) 468-6040 10 * 11 * $Header: D:/logfiles/mods/strconv.mov 1.7 10 Mar 1991 15:33:12 coleb $ 12 * 13 *) 14 15 16 IMPORT ErrorManager; 17 IMPORT Key; 18 IMPORT LowLevel; 19 IMPORT M2Strings; 20 IMPORT Numbers; 21 IMPORT NumTypes; 22 IMPORT PosUtils; 23 IMPORT StrEdit; 24 IMPORT StringIO; 25 IMPORT SYSTEM; 26 27 VAR 28 Initialized : BOOLEAN; 29 30 CONST 31 blank = ' '; 32 33 VAR 34 ten, zero, one : NumTypes.Real8; ***** ^ not supported yet 35 36 37 PROCEDURE StrToReal(TheStr : ARRAY OF CHAR; StartingSpot : ***** ^ not supported yet 38 CARDINAL; VAR TheReal : NumTypes.Real8): BOOLEAN; ***** ^ not supported yet 39 CONST 40 ten = 10.0; 41 one = 1.0; 42 zero = 0.0; 43 digitsize = 16; 44 OrdZero = 48; 45 VAR 46 digit : ARRAY [1..digitsize] OF INTEGER; ***** ^ not supported yet ***** ^ not supported yet 47 expstr : ARRAY [0..24] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 48 temp, WholeNum, r, fac : NumTypes.Real8; ***** ^ not supported yet 49 scalesign, negative : BOOLEAN; 50 scale, DigitsRightOfDec, exp : INTEGER; 51 NumOfBlanks, Zeroes, DecPt, EPos : INTEGER; 52 lngth, limit, spot, DigitArrayIndex, j : INTEGER; 53 BEGIN 54 TheReal := 0.0; ***** ^ not supported yet 55 exp := 0; 56 DigitsRightOfDec := 0; 57 lngth := M2Strings.Length(TheStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 58 spot := StartingSpot; 59 negative := FALSE; 60 WHILE (spot'9')) DO ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 62 IF TheStr[spot]='-' THEN ***** ^ not supported yet ***** ^ not supported yet 63 negative := NOT negative; 64 ELSIF TheStr[spot]='+' THEN ***** ^ not supported yet ***** ^ not supported yet 65 negative := FALSE; 66 END; 67 INC(spot); ***** ^ undeclared identifier ***** ^ not supported yet 68 END; 69 IF (spot>=lngth) THEN 70 RETURN FALSE; 71 END; 72 DigitArrayIndex := 1; 73 WHILE (spot307 THEN 166 RETURN FALSE; 167 END; 168 IF TheReal # zero THEN ***** ^ not supported yet 169 FOR spot := 0 TO 8 DO 170 IF CARDINAL(spot) IN BITSET(scale) THEN ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 171 IF scalesign THEN 172 TheReal := TheReal / NumTypes.R8TenPowers[spot]; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 173 ELSE 174 TheReal := TheReal * NumTypes.R8TenPowers[spot]; ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 175 END; 176 END; 177 END; 178 END; 179 END; 180 RETURN TRUE; 181 END StrToReal; ***** ^ not supported yet 182 183 184 PROCEDURE AppendDecoded(VAR TheStr : ARRAY OF CHAR; TheCodeChar : CHAR; ***** ^ not supported yet 185 StrConst : ARRAY OF CHAR); ***** ^ not supported yet 186 VAR 187 CharNum, spot1, spot2 : CARDINAL; 188 TmpStr : ARRAY [0..255] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 189 tmpchar : CHAR; 190 BEGIN 191 spot2 := M2Strings.Pos(TheCodeChar,StrConst); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 192 spot1 := 0; 193 WHILE spot2<=HIGH(StrConst) DO ***** ^ undeclared identifier ***** ^ not supported yet 194 IF spot2>spot1 THEN 195 M2Strings.Copy(StrConst, spot1, spot2-spot1, TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 196 StrEdit.Append(TheStr, TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 197 (* Copies everything from the start of StrConst, or from 198 the end of the last CharCode, into TheStr. *) 199 END; 200 IF NOT StrToCardinal(StrConst,spot2+1,CharNum) THEN ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 201 ErrorManager.WARN('Invalid string in AppendDecoded'); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 202 END; 203 tmpchar := CHR(CharNum); ***** ^ undeclared identifier ***** ^ not supported yet 204 StrEdit.Append(TheStr, tmpchar); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 205 spot1 := spot2+4; 206 spot2 := PosUtils.Positn(TheCodeChar,StrConst,spot2+1); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 207 END; 208 IF spot1< M2Strings.Length(StrConst) THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 209 M2Strings.Copy(StrConst, spot1, M2Strings.Length(StrConst)-spot1, TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 210 StrEdit.Append(TheStr, TmpStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 211 END; 212 END AppendDecoded; ***** ^ not supported yet 213 214 PROCEDURE CardinalToStr(TheNum : CARDINAL; width : CARDINAL; VAR 215 TheStr : ARRAY OF CHAR); ***** ^ not supported yet 216 VAR 217 spot : INTEGER; 218 tmp : ARRAY [0..80] OF CHAR; ***** ^ not supported yet ***** ^ not supported yet 219 BEGIN 220 LowLevel.Fill(SYSTEM.ADR(TheStr), 1+HIGH(TheStr), blank); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet ***** ^ not supported yet 221 (*Fill TheStr with spaces.*) 222 spot := HIGH(TheStr); ***** ^ undeclared identifier ***** ^ not supported yet 223 REPEAT 224 TheStr[spot] := CHR((TheNum MOD 10)+48); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 225 TheNum := TheNum DIV 10; 226 DEC(spot); ***** ^ undeclared identifier ***** ^ not supported yet 227 UNTIL (TheNum<10) OR (spot<=0); 228 IF TheNum#0 THEN 229 TheStr[spot] := CHR(TheNum+48); ***** ^ not supported yet ***** ^ not supported yet ***** ^ undeclared identifier ***** ^ not supported yet 230 END; 231 IF M2Strings.Length(TheStr)>width THEN ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 232 StrEdit.CutLeadingChars(' ', TheStr); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 233 END; 234 IF M2Strings.Length(TheStr)0 THEN 253 (* We do this to preserve the correct width, 254 if possible. *) 255 TheStr[spot-1] := '-'; ***** ^ not supported yet ***** ^ not supported yet 256 ELSE 257 M2Strings.Insert('-', TheStr, spot); ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet ***** ^ not supported yet 258 END; 259 END; 260 END IntegerToStr; ***** ^ not supported yet 261 262 263 TYPE 264 LongAndShort = 265 RECORD 266 CASE : CHAR OF ***** ^ not supported yet ***** ^ 'POINTER' expected 267 'A' : 268 longi : LONGINT; 269 | 'B' : 270 locard, hicard : CARDINAL; 271 | 'C' : 272 loint, hiint : INTEGER; 273 END; 274 END; 275 VAR 276 TenPowers : ARRAY [0..9] OF LongAndShort; 277 278 PROCEDURE LongIntegerToStr(TheNum : LONGINT; width : CARDINAL; 279 VAR TheStr : ARRAY OF CHAR); 280 VAR 281 LongConv : LongAndShort; 282 positive : BOOLEAN; 283 charstr : ARRAY [0..80] OF CHAR; 284 i : CARDINAL; 285 tmpchar: CHAR; 286 BEGIN 287 LongConv.longi := TheNum; 288 IF LongConv.hiint < 0 THEN 289 TheNum := -TheNum; 290 positive := FALSE; 291 ELSE 292 positive := TRUE; 293 END; 294 (* Fill(ADR(charstr), 10, '0'); replaced below *) 295 charstr[10] := 0C; 296 FOR i := 0 TO 9 DO 297 tmpchar := '0'; 298 WHILE NOT (TheNum < TenPowers[i].longi) DO 299 INC( tmpchar); 300 TheNum := TheNum - TenPowers[i].longi; 301 END; 302 charstr[i] := tmpchar; 303 END; 304 StrEdit.CutLeadingChars('0', charstr); 305 IF NOT positive THEN 306 M2Strings.Insert('-', charstr, 0); 307 END; 308 IF charstr[0]=0C THEN 309 charstr[0] := '0'; 310 charstr[1] := 0C; 311 END; 312 M2Strings.Assign(charstr, TheStr); 313 IF M2Strings.Length(TheStr)'9')) DO 340 IF TheStr[StartingSpot]='-' THEN 341 positive := FALSE; 342 END; 343 INC(StartingSpot); 344 END; 345 IF (StartingSpot>=leng) THEN 346 RETURN FALSE; 347 END; 348 WHILE (StartingSpot='0' 349 ) AND (TheStr[StartingSpot]<='9')) DO 350 TheLong := TheLong * ten; 351 dumlong.hicard := 0; 352 dumlong.locard := ORD(TheStr[StartingSpot])-48; 353 TheLong := TheLong + dumlong.longi; 354 INC(StartingSpot); 355 END; 356 IF NOT positive THEN 357 TheLong := -TheLong; 358 END; 359 RETURN TRUE; 360 END StrToLongInteger; 361 (*$O=*) 362 363 364 PROCEDURE StrToCardinal(TheStr : ARRAY OF CHAR; StartingSpot : 365 CARDINAL; VAR TheCard : CARDINAL) : BOOLEAN; 366 VAR 367 spot, StrLen : CARDINAL; 368 BEGIN 369 spot := StartingSpot; 370 TheCard := 0; 371 StrLen := M2Strings.Length(TheStr); 372 WHILE ((spot'9'))) DO 374 INC(spot); 375 (*Skips all leading non-numeric stuff.*) 376 END; 377 IF spot>=StrLen THEN 378 RETURN FALSE; 379 END; 380 WHILE (spot='0' 381 ) AND (TheStr[spot]<='9') DO 382 TheCard := TheCard*10; 383 INC(TheCard, ORD(TheStr[spot])-48); 384 INC(spot); 385 END; 386 RETURN TRUE; 387 END StrToCardinal; 388 389 390 PROCEDURE StrToInteger(TheStr : ARRAY OF CHAR; StartingSpot : 391 CARDINAL; VAR TheInt : INTEGER) : BOOLEAN; 392 VAR 393 spot, StrLen : CARDINAL; 394 negative : BOOLEAN; 395 BEGIN 396 spot := StartingSpot; 397 TheInt := 0; 398 StrLen := M2Strings.Length(TheStr); 399 negative := FALSE; 400 WHILE ((spot'9'))) DO 402 IF TheStr[spot]='-' THEN 403 negative := NOT negative; 404 (* Means negative will go back to FALSE if 405 there are two leading minus signs; may 406 not be good for much, but why not? *) 407 END; 408 INC(spot); 409 (*Skips all leading non-numeric stuff.*) 410 END; 411 IF spot>=StrLen THEN 412 RETURN FALSE; 413 END; 414 WHILE (spot='0' 415 ) AND (TheStr[spot]<='9') DO 416 TheInt := TheInt*10; 417 INC(TheInt, ORD(TheStr[spot])-48); 418 INC(spot); 419 END; 420 IF negative THEN 421 TheInt := -TheInt; 422 END; 423 RETURN TRUE; 424 END StrToInteger; 425 426 427 PROCEDURE DateToStr(month, day, year : CARDINAL; VAR TheStr : 428 ARRAY OF CHAR); 429 VAR 430 DayStr, MnthStr, YrStr : ARRAY [0..15] OF CHAR; 431 BEGIN 432 CardinalToStr(day, 2, DayStr); 433 IF DayStr[0]=' ' THEN 434 DayStr[0] := '0'; 435 END; 436 CardinalToStr(month, 2, MnthStr); 437 CardinalToStr(year, 2, YrStr); 438 IF M2Strings.Length(YrStr)=4 THEN 439 (*Delete the '19' if it is present.*) 440 M2Strings.Delete(YrStr, 0, 2); 441 END; 442 M2Strings.Assign(MnthStr, TheStr); 443 StrEdit.Append(TheStr, '-'); 444 StrEdit.Append(TheStr, DayStr); 445 StrEdit.Append(TheStr, '-'); 446 StrEdit.Append(TheStr, YrStr); 447 END DateToStr; 448 449 450 PROCEDURE TimeToStr(hours, minutes, seconds, hundredths : CARDINAL; 451 VAR TheStr : ARRAY OF CHAR); 452 VAR 453 HundrStr, SecStr, MinStr, HourStr : ARRAY [0..20] OF CHAR; 454 pm : BOOLEAN; 455 BEGIN 456 CardinalToStr(hundredths, 2, HundrStr); 457 IF HundrStr[0]=' ' THEN 458 HundrStr[0] := '0'; 459 END; 460 CardinalToStr(seconds, 2, SecStr); 461 IF SecStr[0]=' ' THEN 462 SecStr[0] := '0'; 463 END; 464 CardinalToStr(minutes, 2, MinStr); 465 IF MinStr[0]=' ' THEN 466 MinStr[0] := '0'; 467 END; 468 pm := hours>=12; 469 (* 10 July 87: changed from hours > 12 at suggestion of 470 H. A. Hofmans to correct problem with the first noon 471 hour being called am. *) 472 IF hours>12 THEN 473 DEC(hours, 12); 474 END; 475 CardinalToStr(hours, 2, HourStr); 476 M2Strings.Assign(HourStr, TheStr); 477 StrEdit.Append(TheStr, ':'); 478 StrEdit.Append(TheStr, MinStr); 479 StrEdit.Append(TheStr, ':'); 480 StrEdit.Append(TheStr, SecStr); 481 StrEdit.Append(TheStr, ':'); 482 StrEdit.Append(TheStr, HundrStr); 483 IF pm THEN 484 StrEdit.Append(TheStr, 'p'); 485 ELSE 486 StrEdit.Append(TheStr, 'a'); 487 END; 488 END TimeToStr; 489 490 491 PROCEDURE RealToStr( TheNum: NumTypes.Real8; DigitsRightOfDec, 492 width: INTEGER; VAR TheStr: ARRAY OF CHAR); 493 494 CONST 495 ten = 10.0; 496 one = 1.0; 497 zero = 0.0; 498 VAR 499 spot : CARDINAL; 500 i, exp : INTEGER; 501 expstr : ARRAY [0..6] OF CHAR; 502 tmpstr : ARRAY [0..31] OF CHAR; 503 504 PROCEDURE PutDigit(VAR r : NumTypes.Real8); 505 VAR 506 dig : LONGINT; 507 d : CARDINAL; 508 WholePart : NumTypes.Real8; 509 BEGIN 510 dig := Numbers.R8ToL(r); 511 d := Numbers.C(dig); 512 tmpstr[spot] := CHR(d+ORD('0')); 513 INC(spot); 514 WholePart := Numbers.LToR8(dig); 515 r := r - WholePart; 516 END PutDigit; 517 518 BEGIN 519 LowLevel.Fill(SYSTEM.ADR(tmpstr), 1+HIGH(tmpstr), 0C); 520 (*Fill tmpstr with nulls.*) 521 spot := 0; 522 IF TheNum=ten THEN 534 TheNum := TheNum/ten; 535 INC(exp); 536 ELSE 537 EXIT; 538 END; 539 END; 540 END; 541 PutDigit(TheNum); 542 tmpstr[spot] := '.'; 543 INC(spot); 544 FOR i := 1 TO 15 DO 545 TheNum := TheNum*ten; 546 PutDigit(TheNum); 547 END; 548 tmpstr[spot] := 'E'; 549 IntegerToStr(exp, 0, expstr); 550 StrEdit.Append(tmpstr, expstr); 551 IF DigitsRightOfDec < 0 THEN 552 RETURN; 553 END; 554 IF NOT ScientificToPlain( tmpstr, DigitsRightOfDec, 555 width, TheStr ) THEN 556 ErrorManager.WARN('Invalid real'); 557 END; 558 END RealToStr; 559 560 561 PROCEDURE ReturnedCard( TheStr: ARRAY OF CHAR ): 562 CARDINAL; 563 VAR 564 tmpc: CARDINAL; 565 BEGIN 566 IF NOT StrToCardinal( TheStr, 0, tmpc ) THEN 567 StrEdit.Append( TheStr, ' # number' ); 568 ErrorManager.WARN( TheStr ); 569 END; 570 RETURN tmpc; 571 END ReturnedCard; 572 573 PROCEDURE ReturnedInt( TheStr: ARRAY OF CHAR ): 574 INTEGER; 575 VAR 576 tmpi: INTEGER; 577 BEGIN 578 IF NOT StrToInteger( TheStr, 0, tmpi ) THEN 579 StrEdit.Append( TheStr, ' # number' ); 580 ErrorManager.WARN( TheStr ); 581 END; 582 RETURN tmpi; 583 END ReturnedInt; 584 585 586 PROCEDURE ScientificToPlain(scientific : ARRAY OF CHAR; 587 DigitsToRight, width : CARDINAL; VAR plain : ARRAY OF CHAR) : 588 BOOLEAN; 589 VAR 590 RoundSpot, lngth, FirstSpot, eSpot, DotSpot, 591 ProperNumOfDigits : CARDINAL; 592 cnt, DecimalShift : INTEGER; 593 tmpstr : ARRAY [0..79] OF CHAR; 594 carrying : BOOLEAN; 595 e, dot, space, zero : ARRAY [0..0] OF CHAR; 596 (* We use these instead of CHAR constants because this 597 procedure was actually written for the ITC version. 598 See CharStuf module chapter for explanation. *) 599 BEGIN 600 e[0] := 'E'; 601 dot[0] := '.'; 602 space[0] := ' '; 603 zero[0] := '0'; 604 eSpot := M2Strings.Pos(e,scientific); 605 IF NOT StrToInteger(scientific, eSpot, DecimalShift) THEN 606 RETURN FALSE; 607 END; 608 M2Strings.Assign(scientific, tmpstr); 609 M2Strings.Delete(tmpstr, eSpot, 610 (M2Strings.Length(tmpstr) - eSpot) + 1); 611 DotSpot := M2Strings.Pos(dot,tmpstr); 612 IF DotSpot>HIGH(tmpstr) THEN 613 RETURN FALSE; 614 ELSE 615 M2Strings.Delete(tmpstr, DotSpot, 1); 616 END; 617 IF tmpstr[0]='-' THEN 618 FirstSpot := 1; 619 ELSE 620 FirstSpot := 0; 621 END; 622 IF DecimalShift>=0 THEN 623 DotSpot := DotSpot + CARDINAL(DecimalShift); 624 ELSE 625 DecimalShift := -DecimalShift; 626 FOR cnt := 1 TO DecimalShift DO 627 M2Strings.Insert(zero, tmpstr, FirstSpot); 628 END; 629 DotSpot := FirstSpot + 1; 630 END; 631 ProperNumOfDigits := (DotSpot + DigitsToRight); 632 lngth := M2Strings.Length(tmpstr) + 1; 633 IF lngth > ProperNumOfDigits THEN 634 IF LowLevel.ScanNE( ProperNumOfDigits, '9', SYSTEM.ADR(tmpstr) 635 ) < INTEGER(ProperNumOfDigits) THEN 636 (*We can round up without extending length of string.*) 637 RoundSpot := ProperNumOfDigits; 638 carrying := FALSE; 639 WHILE RoundSpot > 0 DO 640 IF (tmpstr[RoundSpot] >= '5') OR carrying THEN 641 INC( tmpstr[RoundSpot - 1] ); 642 carrying := FALSE; 643 END; 644 DEC(RoundSpot); 645 IF tmpstr[RoundSpot] = ':' THEN 646 (*We tried to round up a 9.*) 647 carrying := TRUE; 648 tmpstr[RoundSpot] := '0'; 649 ELSIF tmpstr[RoundSpot] = '/' THEN 650 carrying := TRUE; 651 (*We meant to round up the first digit to the 652 left of the decimal point, but actually rounded up 653 the decimal point itself. The carrying flag 654 will correct it next time through.*) 655 tmpstr[RoundSpot] := '.'; 656 ELSE 657 RoundSpot := 0; 658 (*Forces us out of the loop.*) 659 END; 660 END; 661 END; 662 M2Strings.Delete(tmpstr, ProperNumOfDigits, lngth-ProperNumOfDigits); 663 lngth := ProperNumOfDigits + 1; 664 ELSE 665 WHILE (ProperNumOfDigits + 1) > lngth DO 666 StrEdit.Append(tmpstr, zero); 667 INC(lngth); 668 END; 669 END; 670 M2Strings.Insert(dot, tmpstr, DotSpot); 671 (*We postpone insertion of the dot so that we can scan 672 for non-9's above.*) 673 WHILE (lngth last) OR ( (NOT InQuote) AND PosUtils.Present(s, 723 ';.') ); 724 INC( cnt ); 725 StrEdit.CrunchBlanks( TheSymbol ); 726 END GetSymbol; 727 728 BEGIN 729 last := M2Strings.Length( OldFormStr ); 730 IF last > 0 THEN 731 DEC( last ); 732 ELSE 733 StrEdit.AssignStr( "{0..400}", NewFormStr ); 734 RETURN; 735 END; 736 StrEdit.AssignStr( "{", NewFormStr ); 737 cnt := 0; 738 REPEAT 739 GetSymbol( tmpstr ); 740 IF CAP(tmpstr[0]) = 'E' THEN 741 IF NOT StrToCardinal( tmpstr, 1, tmpcard ) THEN 742 ErrorManager.WARN('Bad set string.'); 743 END; 744 INC( tmpcard, Key.Extended ); 745 CardinalToStr( tmpcard, 0, tmpstr2 ); 746 StrEdit.Append( NewFormStr, tmpstr2 ); 747 ELSE 748 (*These should always be numbers or ellipses.*) 749 IF (tmpstr[0] = '.') THEN 750 M2Strings.Delete( NewFormStr, 751 M2Strings.Length(NewFormStr) - 1, 1 ); 752 (*delete the comma appended in the last loop*) 753 END; 754 StrEdit.Append( NewFormStr, tmpstr ); 755 END; 756 IF (cnt <= last) AND (tmpstr[0] # '.') THEN 757 StrEdit.Append( NewFormStr, ',' ); 758 END; 759 UNTIL cnt > last; 760 StrEdit.Append( NewFormStr, "}" ); 761 END OldSetFormToNew; 762 763 764 PROCEDURE Init(); 765 VAR 766 i : CARDINAL; 767 BEGIN 768 IF Initialized THEN 769 RETURN; 770 ELSE 771 Initialized := TRUE; 772 END; 773 ErrorManager.Init(); 774 Key.Init(); 775 LowLevel.Init(); 776 M2Strings.Init(); 777 Numbers.Init(); 778 NumTypes.Init(); 779 PosUtils.Init(); 780 StrEdit.Init(); 781 782 (*EntryDiag: 783 StringIO.WriteEol( 1, 'Entering StrConv' ); 784 :EntryDiag*) 785 786 FOR i := 5 TO 9 DO 787 TenPowers[i].hicard := 0; 788 END; 789 TenPowers[9].locard := 1; 790 TenPowers[8].locard := 10; 791 TenPowers[7].locard := 100; 792 TenPowers[6].locard := 1000; 793 TenPowers[5].locard := 10000; 794 TenPowers[4].locard := 34464; (* 100,000 *) 795 TenPowers[3].locard := 16960; (* 1,000,000 *) 796 TenPowers[2].locard := 38528; (* 10,000,000 *) 797 TenPowers[1].locard := 57600; (* 100,000,000 *) 798 TenPowers[0].locard := 51712; (* 1,000,000,000 *) 799 TenPowers[4].hicard := 1; (* 100,000 *) 800 TenPowers[3].hicard := 15; (* 1,000,000 *) 801 TenPowers[2].hicard := 152; (* 10,000,000 *) 802 TenPowers[1].hicard := 1525; (* 100,000,000 *) 803 TenPowers[0].hicard := 15258; (* 1,000,000,000 *) 804 805 (*EntryDiag: 806 StringIO.WriteEol( 1, 'Exiting StrConv' ); 807 :EntryDiag*) 808 END Init; 809 810 BEGIN 811 Initialized := FALSE; 812 Init(); 813 END StrConv. 252 errors