home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug175.arc / JRTMAN3.LBR / JRTMAN.1Z5 / JRTMAN.105
Text File  |  1979-12-31  |  24KB  |  758 lines

  1. .OP
  2.  
  3.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -156-
  4.  
  5.  
  6.  
  7.       15.   CRT Formatting
  8.  
  9.  
  10.            This section describes JRT Pascal CRT formatting facilities.  It
  11.       requries  a  basic  knowledge  of  Pascal  and of JRT Pascal external
  12.       procedures.
  13.  
  14.            The CRTMAP utility enables the user  to  quickly  format  a  CRT
  15.       terminal screen.  One record at a time may be displayed.
  16.  
  17.            The  utility  program  takes as its input a Map Description File
  18.       (MDF) which describes the CRT map in a simple command language.   The
  19.       utility  generates the source program for a Pascal external procedure
  20.       which may then be compiled.  This external procedure contains all the
  21.       logic to display all or part of one record  data  type.   Descriptive
  22.       information may also be displayed on the screen.
  23.  
  24.       Source code for CRTMAP is include and its features may be modified or
  25.       extended.   The  distribution  version  of CRTMAP assumes a Televideo
  26.       display terminal.  It  may  be  adapted  to  any  other  terminal  or
  27.       computer  by  modifying  two  lines  in the program.  These two lines
  28.       specify the control codes for cursor  positioning  and  clearing  the
  29.       screen.   Consult your display terminal user manual for the codes for
  30.       your system.  The cursor positioning code is in procedure  GOTOXY  in
  31.       the CRTMAP.PAS file.  The screen clear code is procedure CLEAR.
  32.  
  33.            Procedure  PART2  from CRTMAP.PAS is reproduced here.  This code
  34.       generates "part2" of the  generated  external  procedure.   The  line
  35.       marked  XXX  contains the terminal codes for clearing the CRT screen.
  36.       The line marked YYY contains the terminal codes for moving the cursor
  37.       to a particular position.
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  56. .PAè
  57.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -157-
  58.  
  59.  
  60.  
  61.       procedure part2;
  62.       begin
  63.       writeln(f2; 'procedure clear;');
  64.       writeln(f2; 'begin');
  65.       writeln(f2; 'write(chr(27),''*'');');                        { XXX }
  66.       writeln(f2; 'end;');
  67.       writeln(f2);
  68.       writeln(f2; 'procedure gotoxy (x,y : integer );');
  69.       writeln(f2; 'begin');
  70.       writeln(f2; 'write(chr(27),''='',chr(y+20h),chr(x+20h));');  { YYY }
  71.       writeln(f2; 'end;');
  72.       writeln(f2);
  73.       end; {part2}
  74.  
  75.  
  76.  
  77.               The CRT screen corrdinates have the origin 0,0 in the 
  78.               upper left corner:
  79.  
  80.                       0               x               79
  81.                       ----------------------------------
  82.                    0  !                                !
  83.                       !                                !
  84.                       !                                !
  85.                    y  !                                !
  86.                       !                                !
  87.                       !                                !
  88.                   23  !                                !
  89.                       ----------------------------------
  90.  
  91.               The first coordinate X indicates the column, the second
  92.               Y indicates the row.
  93.  
  94.  
  95.  
  96.       15.1  Structure of the external procedure
  97.  
  98.  
  99.            CRTMAP generates a Pascal external procedure  according  to  the
  100.       parameters in the Map Description File.  This external procedure then
  101.       does the display formatting of your data record.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  110. .PAè
  111.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -158-
  112.  
  113.  
  114.  
  115.               Structure of the generated external procedure:
  116.  
  117.               PART1   EXTERN
  118.                       TYPE
  119.                       %INCLUDE type_declaration_filename
  120.                       PROCEDURE exproc_name
  121.                               ( VAR R : type_name );
  122.  
  123.               PART2   PROCEDURE CLEAR;
  124.                       PROCEDURE GOTOXY;
  125.  
  126.               PART3   PROCEDURE DISPLAY;      { format the CRT }
  127.  
  128.               PART4..PART8 (omitted)
  129.  
  130.               PART9   BEGIN
  131.                       main_line_code
  132.                       END;.
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  164. .PAè
  165.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -159-
  166.       15.2   Map Definition File
  167.            The  MDF defines the format of the CRT screen for the display of
  168.       one record type.  CRTMAP recognizes seven different MDF commands.
  169.  
  170.            The MDF commands MUST be entered in a fixed sequence except  for
  171.       LITERAL  and  FIELD  which  may  be  intermixed.  There should be one
  172.       command per line.  Blank lines may be inserted for readability.
  173.  
  174.               EXPROC = eeeeeeee
  175.               INCLUDE = iiiiiiii
  176.               RECORD = rrrrrrrr
  177.  
  178.               any number of intermixed LITERAL and FIELD commands
  179.  
  180.               CURSOR = x,y
  181.               END
  182.     MDF Commands
  183.       EXPROC - the name of  the  external  procedure  to  be  generated  by
  184.               CRTMAP.
  185.       INCLUDE  -  the  name  of  the  %INCLUDE file which contains the TYPE
  186.               declaration of the record to be displayed and all  TYPEs  and
  187.               CONSTants to which it refers.
  188.               example:
  189.               INCLUDE = TYPES.DCL
  190.  
  191.       RECORD - the name of the record data type to be displayed - this type
  192.               declaration is in the include file.
  193.  
  194.       LITERAL  -  causes  a  character  string  to  be displayed on the CRT
  195.               screen, the string must be entered between single quotes.
  196.  
  197.               LITERAL column, row, 'literal string to be displayed'
  198.  
  199.               examples:
  200.               LITERAL 0,0,'* this is the upper left corner'
  201.               LITERAL 40,12,'* this is about the center'
  202.               LITERAL 0,23,'bottom row of the crt'
  203.  
  204.               screen coordinates have the origin  0,0  in  the  upper  left
  205.               corner,  first number X is the column, second number Y is the
  206.               row.
  207.  
  208.       FIELD - causes a field in the input record to  be  displayed  at  the
  209.               specified  location,  may  include optional minimum width and
  210.               decimal places numbers for displaying integers and reals.
  211.  
  212.               FIELD column, row, field_name  {:min_width {:dec_places}}
  213.  
  214.               FIELD 10,20, customer_name
  215.  
  216.  
  217.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  218. .PAè
  219.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -160-
  220.  
  221.  
  222.  
  223.               FIELD 12,20, account_balance:10:2
  224.               FIELD 20,60, days_until_armageddon:1
  225.  
  226.       CURSOR - specifies where the  cursor  should  be  positioned  on  the
  227.               screen after the record is displayed.
  228.  
  229.               CURSOR column, row
  230.  
  231.       END - indicates end of Map Description File, ALWAYS required.
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  272. .PAè
  273.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -161-
  274.  
  275.  
  276.  
  277.       15.3  Operating CRTMAP
  278.  
  279.  
  280.            To  operate  CRTMAP,  first  prepare  the  Map  Description File
  281.       (section 15.2).  Prepare a file containing the record to be displayed
  282.       and its subordinate type declarations -  this  will  be  the  INCLUDE
  283.       file.
  284.  
  285.            Make  sure  the  CRTMAP  utility  was  modified  to support your
  286.       terminal type (see section 15.).
  287.  
  288.            To run the utility, enter:
  289.  
  290.               EXEC CRTMAP
  291.  
  292.            It will ask for the  "filename.type"  of  your  Map  Description
  293.       File.
  294.  
  295.            On  successful termination of CRTMAP, the new external procedure
  296.       source file will be found on the default disk.  It must  be  compiled
  297.       with the JRT Pascal version 3 compiler.
  298.  
  299.  
  300.  
  301.       15.4   CRTMAP example
  302.  
  303.  
  304.            An example of the use of the CRTMAP utility is provided here.  A
  305.       simple   customer   record  is  formatted  and  displayed.   The  Map
  306.       Definition  File  named  MDF  is  listed.   The  include  file  named
  307.       CUSTOMER.PAS   contains  the  main  record  declaration  CUST  and  a
  308.       subordinate declaration CHAR30.
  309.  
  310.            The external procedure generated by CRTMAP is named  CUSTMAP.PAS
  311.       and is listed.
  312.  
  313.            A complete compiler listing of CRTMAP.PAS follows.
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  326. .PAè
  327.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -162-
  328.       Operation flowchart of CRTMAP utility (ver 3.0)
  329.  
  330.                                     Map
  331.                                 Description
  332.                                     File
  333.                                       !
  334.                                       !
  335.                                       !
  336.                                       !
  337.                                       V
  338.                               -----------------
  339.                               !               !
  340.                               !   CRTMAP      !
  341.                               !    utiltiy    !
  342.                               !               !
  343.                               -----------------
  344.                                       !
  345.                                       !
  346.                                       !
  347.                                       V
  348.                                 Pascal source
  349.                                 code external     %include
  350.                                   procedure         file
  351.                                       !               / 
  352.                                       !              /
  353.                                       !             /
  354.                                       !            /
  355.                                       !           /
  356.                                       !          /
  357.                                       !         /
  358.                                       !        /
  359.                                       !       /
  360.                                       V      V
  361.                               -----------------
  362.                               !               !
  363.                               !   JRTPAS3     !
  364.                               !               !
  365.                               -----------------
  366.                                       !
  367.                                       !
  368.                                       !
  369.                                       !
  370.                                       V
  371.                                   compiled
  372.                                 CRT mapping
  373.                                   external
  374.                                  procedure
  375.  
  376.  
  377.  
  378.  
  379.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  380. .PAè
  381.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -163-
  382.  
  383.  
  384.  
  385.         CRT Screen formatted by CUSTMAP external procedure
  386.  
  387.       -----------------------------------------------------------------
  388.       !                                                               !
  389.       !  ---------- CUSTOMER RECORD ----------                        !
  390.       !                                                               !
  391.       !                                                               !
  392.       !       Name  PASCAL, BLAISE                                    !
  393.       !                                                               !
  394.       !       Addr  777 RUE D'ARGENT                                  !
  395.       !                                                               !
  396.       !       City  PARIS                                             !
  397.       !                                                               !
  398.       !                                                               !
  399.       !                                                               !
  400.       !                                                               !
  401.       !       Balance  $   1490.34                                    !
  402.       !                                                               !
  403.       !                                                               !
  404.       !                                                               !
  405.       !                                                               !
  406.       !  _                                                            !
  407.       ! !_!                                                           !
  408.       !_______________________________________________________________!
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  434. .PAè
  435.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -164-
  436.  
  437.  
  438.  
  439.       File CUSTOMER.PAS
  440.       contains TYPE declaration of customer data record
  441.  
  442.  
  443.       CHAR30 = ARRAY [1..30] OF CHAR;
  444.       CUST =   RECORD
  445.                NAME : CHAR30;
  446.                ADDRESS : CHAR30;
  447.                CITY : CHAR30;
  448.                BALANCE : REAL;
  449.                END;
  450.  
  451.  
  452.  
  453.  
  454.       FILE MDF
  455.       contains Map Definition File which describes CRT screen format
  456.  
  457.  
  458.       EXPROC = CUSTMAP
  459.       INCLUDE = CUSTOMER.PAS
  460.       RECORD = CUST
  461.  
  462.       LITERAL = 0,0,'---------- CUSTOMER RECORD ----------'
  463.  
  464.       LITERAL = 5,3,'Name '
  465.       FIELD =12,3,NAME
  466.  
  467.       LITERAL = 5,5,'Addr '
  468.       FIELD = 12,5,ADDRESS
  469.  
  470.       LITERAL = 5,7,'City '
  471.       FIELD = 12,7,CITY
  472.  
  473.       LITERAL = 15,14,'Balance $'
  474.       FIELD = 15,14,BALANCE:8:2
  475.  
  476.       CURSOR = 0,22
  477.       END
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  488. .PAè
  489.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -165-
  490.       File CUSTMAP.PAS
  491.       Pascal external procedure generated by CRTMAP utility
  492.  
  493.       { CRTMAP generated external procedure }
  494.       extern
  495.       type
  496.       %include ('CUSTOMER.PAS    ')
  497.  
  498.       procedure CUSTMAP         ( var r : CUST            );
  499.  
  500.       procedure clear;
  501.       begin
  502.       write(chr(27),'*');
  503.       end;
  504.  
  505.       procedure gotoxy ( x,y : integer );
  506.       begin
  507.       write(chr(27),'=',chr(y+20h),chr(x+20h));
  508.       end;
  509.  
  510.       procedure display;
  511.       begin
  512.       clear;
  513.       gotoxy( 0               ,0               );
  514.       write('---------- CUSTOMER RECORD ----------');
  515.       gotoxy( 5               ,3               );
  516.       write('Name ');
  517.       gotoxy( 12              ,3               );
  518.       write( r,NAME            );
  519.       gotoxy( 5               ,5               );
  520.       write('Addr ');
  521.       gotoxy( 12              ,5               );
  522.       write( r,ADDRESS         );
  523.       gotoxy( 5               ,7               );
  524.       write('City ');
  525.       gotoxy( 12              ,7               );
  526.       write( r,CITY            );
  527.       gotoxy( 5               ,14              );
  528.       write('Balance $');
  529.       gotoxy( 15              ,14              );
  530.       write( r,BALANCE:8:2     );
  531.       gotoxy( 0               ,22              );
  532.       end;
  533.  
  534.       begin
  535.       display;
  536.       end;.
  537.  
  538.  
  539.  
  540.  
  541.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  542. .PAè      JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -166-
  543. JRT Pascal ver 3.0              CRTMAP                          Page 001
  544.                 ----- CRT Mapping Utility -----
  545. 0000  0002:     %page(50)
  546. 0000  0003:
  547. 0000  0004:     { This version setup for Televideo terminals. To adapt to oth
  548. 0000  0005:     terminals modify PROCEDURE PART2 which generates the cursor
  549. 0000  0006:     positioning (gotoxy) and clear screen (clear) codes. }
  550. 0000  0007:
  551. 0000  0008:     program crtmap;
  552. 0000  0009:
  553. 0003  0010:     type
  554. 0010  0011:     char16 = array [1..16] of char;
  555. 0010  0012:
  556. 0010  0013:     var
  557. 0010  0014:     ch : char;
  558. 0010  0015:     alphameric : set of char;
  559. 0010  0016:     end_of_file : boolean;
  560. 0010  0017:     map_file_name : string[15];
  561. 0010  0018:     word : char16;
  562. 0010  0019:     exproc_name : char16;
  563. 0010  0020:     include_name : char16;
  564. 0010  0021:     record_name : char16;
  565. 0010  0022:     f1, f2 : file of char;
  566. 0010  0023:
  567. 0010  0024:
  568. 0010  0025:     procedure error ( msg : string[40] );
  569. 0013  0026:     var
  570. 0013  0027:     dummy : char16;
  571. 0016  0028:     begin
  572. 001A  0029:     writeln;
  573. 001E  0030:     writeln;
  574. 0028  0031:     writeln(msg);
  575. 002C  0032:     writeln;
  576. 002C  0033:     { abnormally terminate - return to CP/M }
  577. 0034  0034:     call(0,dummy,dummy);
  578. 0035  0035:     end;
  579. 0035  0036:
  580. 0035  0037:     procedure get_char;
  581. 003B  0038:     begin
  582. 004C  0039:     read(f1; ch);
  583. 0081  0040:     if ch = chr(1ah) then error('Premature end of input file');
  584. 008D  0041:     write(ch);
  585. 008E  0042:     end;
  586. 008E  0043:
  587. 008E  0044:     procedure get_word;
  588. 0091  0045:     label 99;
  589. 0091  0047:     var
  590. 0091  0047:     i : integer;
  591. 0094  0048:     begin
  592. 009D  0049:     word := ' ';
  593. 00AC  0050:     while not (ch in alphameric) do
  594. 00AC  0051:             begin
  595.  
  596. .PAè
  597.       JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -167-
  598. JRT Pascal ver 3.0              CRTMAP                          page 002
  599.                 ----- CRT Mapping Utility -----
  600. 00B1  0052:             get_char;
  601. 00B4  0053:             end;
  602. 00C4  0054:     word[1] := ch;
  603. 00C9  0055:     i := 2;
  604. 00CE  0056:     get_char;
  605. 00DC  0057:     while (ch in alphameric) do
  606. 00DC  0058:             begin
  607. 00EF  0059:             word[i] := ch;
  608. 00F9  0060:             i := i + 1;
  609. 00FE  0061:             get_char;
  610. 0101  0062:             end;
  611. 010E  0063:     word := upcase(word);
  612. 010F  0064:     end; {get_word}
  613. 010F  0065:
  614. 010F  0066:
  615. 010F  0067:     procedure init;
  616. 0115  0068:     begin
  617. 012C  0069:     writeln('CRTMAP  ver 3.0');
  618. 0130  0070:     writeln;
  619. 0157  0071:     write('name of Map Desription File : ');
  620. 0160  0072:     readln(map_file_name);
  621. 0164  0073:     writeln;
  622. 0168  0074:     writeln;
  623. 0177  0075:     reset(f1,map_file_name,binary,256);
  624. 017C  0076:     end_of_file := false;
  625. 0185  0077:     ch := ' ';
  626. 01A7  0078:     alphameric := ['A'..'Z','a'..'z','0'..'9',':','.'];
  627. 01AC  0079:     get_word;
  628. 01E1  0080:     if word <> 'EXPROC' then error('EXPROC command expected');
  629. 01E6  0081:     get_word;
  630. 01F2  0082:     exproc_name := word;
  631. 020A  0083:     rewrite(f2, exproc_name + '.pas', binary, 256);
  632. 020F  0084:     get_word;
  633. 0246  0085:     if word <> 'INCLUDE' then error('INCLUDE' command expected');
  634. 024B  0086:     get_word;
  635. 0257  0087:     include_name := word;
  636. 025C  0088:     get_word;
  637. 0291  0089:     if word <> 'RECORD' then error('RECORD' command expected');
  638. 0296  0090:     get_word;
  639. 02A2  0091:     record_name := word;
  640. 02A3  0092:     end; {init}
  641. 02A3  0093:
  642. 02A3  0094:
  643. 02A3  0095:     procedure part1;
  644. 02A9  0096:     begin
  645. 02DF  0097:     writeln(f2; '{CRTMAP generated external procedure }');
  646. 02F4  0098:     writeln(f2; 'extern');
  647. 02FF  0099:     writeln(f2);
  648. 0312  0100:     writeln(f2; 'type');
  649. 033C  0101:     writeln(f2; '%include (''',include_name,''')');
  650. .PAè      JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -168-
  651. JRT Pascal ver 3.0              CRTMAP                          page 003
  652.                 ----- CRT Mapping Utility -----
  653. 0347  0102:     writeln(f2);
  654. 0386  0103:     writeln(f2; 'procedure ',exproc_name, '(var r : '.recor_nam
  655. ');');
  656. 0391  0104:     writeln(f2);
  657. 0392  0105:     end; {part1}
  658. 0392  0106:
  659. 0392  0107:
  660. 0392  0108:     procedure part2;
  661. 0398  0109:     begin
  662. 03B7  0110:     writeln(f2; 'procedure clear;');
  663. 03CB  0111:     writeln(f2; 'begin');
  664. 03ED  0112:     writeln(f2; 'write(chr(27),''*'');');
  665. 0400  0113:     writeln(f2; 'end;');
  666. 040B  0114:     writeln(f2);
  667. 043D  0115:     writeln(f2; 'procedure gotoxy ( x,y : integer );');
  668. 0451  0116:     writeln(f2; 'begin');
  669. 0489  0117:     writeln(f2; 'write(chr(27),''='',chr(y+20h),chr(x+20h));');
  670. 049C  0118:     writeln(f2; 'end;');
  671. 04A7  0119:     writeln(f2);
  672. 04A8  0120:     end; {part2}
  673. 04A8  0121:
  674. 04A8  0122:
  675. 04A8  0123:     procedure part3;       {create DISPLAY procedure}
  676. 04A8  0124:
  677. 04AB  0125:     procedure process_coordinates;
  678. 04AE  0126:     var
  679. 04AE  0127:     x_coord, y_coord : char16;
  680. 04B1  0128:     begin
  681. 04B6  0129:     get_word;
  682. 04C2  0130:     x_coord := word;
  683. 04C7  0131:     get_word;
  684. 04D3  0132:     y_coord := word;
  685. 0507  0133:     writeln(f2; 'gotoxy( ',x_coord,',',y_coord,');');
  686. 0508  0134:     end;
  687. 0508  0135:
  688. 0508  0136:     procedure process_string;
  689. 050E  0137:     begin
  690. 050E  0138:     {find start of string}
  691. 052E  0139:     while not (ch in ['''',chr(0dh),' ',chr(9),chr(1ah)]) do
  692. 0536  0140:             get_char;
  693. 0566  0141:     if ch <> '''' then error('Literal string expected');
  694. 057B  0142:     write(f2; 'write(');
  695. 057B  0143:     repeat
  696. 058E  0144:       write(f2; ch);
  697. 0593  0145:       get_char;
  698. 05A1  0146:     until ch = chr(0dh);
  699. 05B2  0147:     writeln(f2; ');');
  700. 05B3  0148:     end;
  701. 05B3  0149:
  702. 05B3  0150:
  703. 05B6  0151:     begin {part3}
  704. .PAè      JRT Pascal  User's Guide     version 3.0         NOT FOR SALE   -169-
  705. JRT Pascal ver 3.0              CRTMAP                          page 004
  706.                 ----- CRT Mapping Utility -----
  707. 05D7  0152:     writeln(f2; 'procedure display;');
  708. 05EB  0153:     writeln(f2; 'begin');
  709. 0600  0154:     writeln(f2; 'clear;');
  710. 0608  0155:     while not end_of_file do
  711. 0608  0156:             begin
  712. 060D  0157:             get_word;
  713. 0613  0158:             case word of
  714. 0621  0159:             'LITERAL' :
  715. 0621  0160:                     begin
  716. 0626  0161:                     process_coordinates;
  717. 062B  0162:                     process_string;
  718. 062E  0163:                     end;
  719. 063A  0164:             'FIELD' :
  720. 063A  0165:                     begin
  721. 063F  0166:                     process_coordinates;
  722. 0644  0167:                     get_word;
  723. 066C  0168:                     writeln(f2; 'write( r,',word,');');
  724. 066F  0169:                     end;
  725. 0684  0170:             'CURSOR' : process_coordinates;
  726. 0696  0171:             'END' : end_of_file := true;
  727. 06D3  0172:             else : error('LITERAL, FIELD, CURSOR, or END command ex
  728. cted');
  729. 06D4  0173:             end;
  730. 06D7  0174:             end;
  731. 06EA  0175:     writeln(f2; 'end;' );
  732. 06F5  0176:     writeln(f2);
  733. 06F6  0177:     end; {part3}
  734. 06F6  0178:
  735. 06F6  0179:
  736. 06F6  0180:     procedure part9;
  737. 06FC  0181:     begin
  738. 0710  0182:     writeln(f2; 'begin');
  739. 0727  0183:     writeln(f2; 'display;');
  740. 073B  0184:     writeln(f2; 'end;.');
  741. 073C  0185:     end; {part9}
  742. 073C  0186:
  743. 073C  0187:
  744. 073F  0188:     begin {crtmap}
  745. 0744  0189:     init;
  746. 0749  0190:     part1;
  747. 074E  0191:     part2;
  748. 0753  0192:     part3;
  749. 0758  0193:     part9;
  750. 075C  0194:     close(f1);
  751. 0760  0195:     close(f2);
  752. 0761  0196:     end {crtmap}.
  753. No errors detected
  754. Module size = 1893 dec bytes
  755. End of compile for CRTMAP
  756.  
  757.       Copy compliments of Merle Schnick         SECTION 15:  CRT Formatting
  758. .PAè