home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / MADTRB2.ZIP / S_INPUT1.INC < prev    next >
Encoding:
Text File  |  1986-03-01  |  26.1 KB  |  568 lines

  1. { S_INPUT1.INC }
  2.  
  3. { *************************************************************************** }
  4. { *                                                                         * }
  5. { *                TURBO SCREEN INPUT PRE-PROCESSOR TOOLKIT                 * }
  6. { *                                                                         * }
  7. { *               SCROLLING INPUT SUBPROGRAM INCLUDE FILE  #1               * }
  8. { *                                                                         * }
  9. { *                             Version  1.07                               * }
  10. { *                                                                         * }
  11. { *                                                                         * }
  12. { *    This is the first include file for the scrolling window page         * }
  13. { *    module.  This file wust be used in conjunction with the include      * }
  14. { *    file 'S_Input2.Inc' .                                                * }
  15. { *                                                                         * }
  16. { *    Note that further documentation on scrolling input page support can  * }
  17. { *    be found in the documentation file 'Tsipp.Doc'.                      * }
  18. { *                                                                         * }
  19. { *    Note that this subprogram is written so that for every scrolling     * }
  20. { *    page, the top, bottom, and left edge of the scrolling window are     * }
  21. { *    constant and only the right edge of the scrolling window can vary    * }
  22. { *    for each scrolling input page.                                       * }
  23. { *                                                                         * }
  24. { *    Inorder to have complete mobility with the location of the scrolling * }
  25. { *    window for every scrolling input page, change the constants which    * }
  26. { *    specify the location of the top, bottom, and left edge of the        * }
  27. { *    scrolling window into functions, similar to the two functions        * }
  28. { *    defining the right edge of the scrolling window.                     * }
  29. { *                                                                         * }
  30. { *************************************************************************** }
  31.  
  32.  
  33.  
  34. Const { Scrolling Input Page Constants }
  35.  
  36.   S_I_ENTRY_LIMIT=20;                { number of input data rows in the scrolling window }
  37.  
  38.   TOP_EDGE_OF_OUTER_SCROLL_WINDOW=13;   { top physical screen row of the outer window used in scrolling input }
  39.                                         { data up, down, left, and right.  This value can range from 1 to 24. }
  40.   BOTTOM_EDGE_OF_OUTER_SCROLL_WINDOW=23;{ bottom physical screen row of the outer window used in scrolling input }
  41.                                         { data up, down, left, and right.  This value can range from 2 to 25. }
  42.   LEFT_EDGE_OF_OUTER_SCROLL_WINDOW=4;   { left physical screen row of the outer window used in scrolling input }
  43.                                         { data up, down, left, and right. }
  44.  
  45.   TOP_EDGE_OF_INNER_SCROLL_WINDOW=18;   { top physical screen row of the inner window used in scrolling input }
  46.                                         { data up, down, left, and right.  This value can range from 1 to 245. }
  47.   BOTTOM_EDGE_OF_INNER_SCROLL_WINDOW=22;{ bottom physical screen row of the inner window used in scrolling input }
  48.                                         { data up, down, left, and right.  This value can range from 2 to 25. }
  49.   LEFT_EDGE_OF_INNER_SCROLL_WINDOW=7;   { left physical screen row of the inner window used in scrolling input }
  50.                                         { data up, down, left, and right. }
  51.  
  52.   MAX_LEFT_COL=1;                    { leftmost input data column that the scrolling window can access and display }
  53.                                      { This value is normally 1. }
  54.  
  55.   MAX_NUM_OF_S_I_PROMPT_COLS=7;      { maximum number of column prompts in the scrolling window }
  56.                                      { Usually this number is found to be MaxRightCol-MAX_LEFT_COL+1 }
  57.  
  58.   MAX_NUM_OF_S_I_DATA_COLS=6;        { maximum number of columns in the input data array }
  59.                                      { Usually this number is found to be MaxRightCol-MAX_LEFT_COL, or one less than }
  60.                                      { MAX_NUM_OF_S_I_PROMPT_COL since the first column is usually an index column. }
  61.  
  62.   COL_WIDTH=10;                      { physical width of screen columns that are displayed within the scrolling window }
  63.                                      { All columns that are displayed within the scroll window are of the same width }
  64.  
  65.   MAX_SIZE_OF_S_I_PROMPT=9;          { maximum size of column prompt heading string entry.  Must be one less than }
  66.                                      { COL_WIDTH for no overlap to occur with column prompt headings. }
  67.  
  68.   MAX_SIZE_OF_S_I_ENTRY=7;           { maximum size of input data entry string.  Must be one less than COL_WIDTH for }
  69.                                      { no overlap to occur with adjacent columns. }
  70.  
  71.  
  72.  
  73. Type { Scrolling Input Page Data Structure }
  74.  
  75.   S_I_ColPrompts=                    { record type used for S_I column template used to }
  76.     Record                           { store specific information about a particular column heading. }
  77.       Prompt1,                       { Note that this prompt record type allows only three lines per column heading. }
  78.       Prompt2,
  79.       Prompt3:String[MAX_SIZE_OF_S_I_PROMPT];
  80.       InputDataType:Integer;         { allowable input data type for a particular input column }
  81.     End; { S_I_PageRecord }
  82.  
  83.   S_I_Prompts=                       { S_I column prompt template used to store the column }
  84.     Array[1..MAX_NUM_OF_S_I_PROMPT_COLS] of S_I_ColPrompts; { prompts for a particular S_I Page }
  85.  
  86.   Typical_S_I_Page=                  { an record data type which stores }
  87.     Record                           { for each scrolling input page: }
  88.       Image:TextScreenPtr;           { a scrolling input page screen image }
  89.       Prompts:S_I_Prompts;           { a record of the column prompts for each page }
  90.     End; { Typical_G_I_Page }
  91.  
  92.   S_I_DataEntryPtr=^S_I_DataEntry;             { pointer to an input data string entry }
  93.   S_I_DataEntry=String[MAX_SIZE_OF_S_I_ENTRY]; { data string type used for storing input data entries }
  94.  
  95.  
  96.  
  97. Var { Scrolling Input Page Data Structure Variables }
  98.  
  99.   S_I_Pages:
  100.     Array[1..MAX_NUM_OF_S_I_PAGES] Of Typical_S_I_Page;           { an array constructed of the data type Typical }
  101.                                                                   { scrolling input page }
  102.  
  103.   S_I_Data:                                                       { three dimensional array for storing input data from }
  104.     Array[1..MAX_NUM_OF_S_I_DATA_COLS,                            { the S_I_Pages }
  105.           1..S_I_ENTRY_LIMIT,
  106.           1..MAX_NUM_OF_S_I_PAGES] Of S_I_DataEntryPtr;
  107.  
  108.  
  109.  
  110. Procedure Read_S_I_Files;
  111.  
  112. { This procedure reads the scrolling input screen page images and templates
  113.   and stores them into the proper S_I_Pages[S_I_Page] record.  Note that
  114.   S_I_Page screen page images are stored under the file names
  115.   'S_I_##.Col(or Mon)', where ## refers to the S_I_Page number, 'Col' refers
  116.   to a color screen page, and 'Mon' refers to a monochrome screen page.  Note
  117.   that S_I_Page templates are stored under the file names 'S_I_##.@@@', where
  118.   ## refers to the S_I_Page number and '@@@' refers to template file
  119.   extension constant previously defined in the file 'Main.Mod'.
  120.  
  121.   Note that the template records are pointed to by the template array (an
  122.   array of pointers) and if there are not enough records from the template
  123.   file to fill the template array of pointers for a particular menu page,
  124.   those empty array pointers are set to Nil. }
  125.  
  126. Var
  127.   S_I_Page:Integer;                    { an index to a particular S_I_Page }
  128.   Column:Integer;                      { an index to a particular S_I_Page template column entry }
  129.   Page:String[2];                      { a string used in determining the current S_I_Page file number }
  130.   S_I_TemplateFile:File Of S_I_ColPrompts; { S_I_Page file template type }
  131.  
  132. Begin   { Read_S_I_Files }
  133.   For S_I_Page:=1 To MAX_NUM_OF_S_I_PAGES Do
  134.     With S_I_Pages[S_I_Page] Do
  135.       Begin
  136.  
  137.         { determine file number portion of S_I_Page file name }
  138.         Str(S_I_Page,Page);            { convert integer file number into a string }
  139.         If S_I_Page<=9 Then
  140.           Page:='0'+Page;
  141.  
  142.         { initializing screen page pointer }
  143.         Image:=Nil;
  144.  
  145.         { read S_I_Page screen image }
  146.         ReadScreenPageFromFile('S_I_'+Page,Image);
  147.  
  148.       End; { With S_I_Pages[S_I_Page] }
  149.  
  150.   { read S_I_Page template }
  151.   Assign(S_I_TemplateFile,'S_Input'+TEMPLATE_FILE_NAME_EXTENSION); { assign to a disk file }
  152.   Reset(S_I_TemplateFile);         { open the file for reading }
  153.   For S_I_Page:=1 To MAX_NUM_OF_S_I_PAGES Do
  154.     For Column:=1 To MAX_NUM_OF_S_I_PROMPT_COLS Do
  155.       Read(S_I_TemplateFile,S_I_Pages[S_I_Page].Prompts[Column]); { read record off of disk }
  156.   Close(S_I_TemplateFile);         { close the file }
  157.  
  158. End;    { Read_S_I_Files }
  159.  
  160.  
  161.  
  162. Procedure Init_S_I_DataEntries;
  163.  
  164. { This procedure initializes the scrolling input page input data array. }
  165.  
  166. Var
  167.   Page:Integer;                        { an index to a particular S_I_Page }
  168.   Row:Integer;                         { an index to a particular S_I_Page column }
  169.   Col:Integer;                         { an index to a particular S_I_Page row }
  170.  
  171. Begin   { Init_S_I_DataEntries }
  172.   For Page:=1 To MAX_NUM_OF_S_I_PAGES Do        { pages }
  173.     For Row:=1 To S_I_ENTRY_LIMIT Do            { rows }
  174.       For Col:=1 To MAX_NUM_OF_S_I_DATA_COLS Do { columns }
  175.         Begin
  176.           New(S_I_Data[Col,Row,Page]); { allocate space in heap for input data }
  177.           S_I_Data[Col,Row,Page]^:='';
  178.         End; { For Col }
  179. End;    { Init_S_I_DataEntries }
  180.  
  181.  
  182.  
  183. Procedure DisposeOf_S_I_DynamicMemory;
  184.  
  185. { This procedure releases all the dynamically allocated memory used in the
  186.   scrolling input pages back to the operating system. }
  187.  
  188. Var
  189.   S_I_Page:Integer;                    { an index to a particular S_I_Page }
  190.   Row:Integer;                         { an index to a particular S_I_Page column }
  191.   Col:Integer;                         { an index to a particular S_I_Page row }
  192.  
  193. Begin   { DisposeOf_S_I_DynamicMemory }
  194.   For S_I_Page:=1 To MAX_NUM_OF_S_I_PAGES Do      { pages }
  195.     Begin
  196.       With S_I_Pages[S_I_Page] Do
  197.         Dispose(Image);                           { dispose screen page image }
  198.       For Row:=1 To S_I_ENTRY_LIMIT Do            { rows }
  199.         For Col:=1 To MAX_NUM_OF_S_I_DATA_COLS Do { columns }
  200.           Dispose(S_I_Data[Col,Row,S_I_Page]);    { dispose of data entry }
  201.     End; { For S_I_Page }
  202. End;    { DisposeOf_S_I_DynamicMemory }
  203.  
  204.  
  205.  
  206. Function RightEdgeOfOuterScrollWindow:Integer;
  207.  
  208. { This function returns an integer value which describes the location of the
  209.   far right physical edge of the outer scrolling data window.  This function is
  210.   necessary since the scrolling window can change in width for each particular
  211.   scrolling page. Note that the case statement below only supports 4 scrolling
  212.   input pages, but can easily be added to inorder to support additional
  213.   pages. }
  214.  
  215. Begin   { RightEdgeOfOuterScrollWindow }
  216.   Case S_I_Page Of
  217.     1 : Begin
  218.           RightEdgeOfOuterScrollWindow:=48; { 3 data columns displayed }
  219.         End;   { page 1 }
  220.     2 : Begin
  221.           RightEdgeOfOuterScrollWindow:=28; { 1 data column displayed }
  222.         End;   { page 2 }
  223.     3 : Begin
  224.           RightEdgeOfOuterScrollWindow:=77; { 6 data columns displayed }
  225.         End;   { page 3 }
  226.     4 : Begin
  227.           RightEdgeOfOuterScrollWindow:=48; { 3 data columns displayed }
  228.         End;   { page 4 }
  229.   End; { Case Page }
  230. End;    { RightEdgeOfOuterScrollWindow }
  231.  
  232.  
  233.  
  234. Function RightEdgeOfInnerScrollWindow:Integer;
  235.  
  236. { This function returns an integer value which describes the location of the
  237.   far right physical edge of the inner scrolling data window.  This function is
  238.   necessary since the scrolling window can change in width for each particular
  239.   scrolling page. Note that the case statement below only supports 4 scrolling
  240.   input pages, but can easily be added to inorder to support additional
  241.   pages. }
  242.  
  243. Begin   { RightEdgeOfInnerScrollWindow }
  244.   Case S_I_Page Of
  245.     1 : Begin
  246.           RightEdgeOfInnerScrollWindow:=46; { 3 data columns displayed }
  247.         End;   { page 1 }
  248.     2 : Begin
  249.           RightEdgeOfInnerScrollWindow:=26; { 1 data column displayed }
  250.         End;   { page 2 }
  251.     3 : Begin
  252.           RightEdgeOfInnerScrollWindow:=75; { 6 data columns displayed }
  253.         End;   { page 3 }
  254.     4 : Begin
  255.           RightEdgeOfInnerScrollWindow:=46; { 3 data columns displayed }
  256.         End;   { page 4 }
  257.   End; { Case Page }
  258. End;    { RightEdgeOfInnerScrollWindow }
  259.  
  260.  
  261.  
  262. Function MaxRightCol:Integer;
  263.  
  264. { This function returns an integer value which describes the maximum right
  265.   input data column that the current scolling data window can access and
  266.   display data, corresponding to the current scrolling input page.  This
  267.   function is necessary since each scrolling page can access a different amount
  268.   of data columns.  Note that the case statement below only supports 4
  269.   scrolling input pages, but can easily be added to inorder to support
  270.   additional pages.  Note also that MaxRightCol does not necessarily correspond
  271.   to the number of actual columns being displayed.  For example, the first
  272.   column on the screen might be a row identifier value and thus there would be
  273.   1 more column displayed in the scrolling window than this function would have
  274.   us believe. }
  275.  
  276. Begin   { MaxRightCol }
  277.   Case S_I_Page Of
  278.     1 : Begin
  279.           MaxRightCol:=5;              { maximum of 5 data columns can be accessed }
  280.         End;   { page 1 }
  281.     2 : Begin
  282.           MaxRightCol:=3;              { maximum of 3 data columns can be accessed }
  283.         End;   { page 2 }
  284.     3 : Begin
  285.           MaxRightCol:=6;              { maximum of 6 data columns can be accessed }
  286.         End;   { page 3 }
  287.     4 : Begin
  288.           MaxRightCol:=3;              { maximum of 3 data columns can be accessed }
  289.         End;   { page 4 }
  290.   End; { Case S_I_Page }
  291. End;    { MaxRightCol }
  292.  
  293.  
  294.  
  295. Procedure HighlightSpecial_S_I_Prompts(    CurrentLeftMostDataCol,
  296.                                            CurrentRightMostDataCol:Integer);
  297.  
  298. { This procedure highlights the special quick input keystrokes for specific
  299.   S_I_Page prompts.  Note that the case statement below only supports 4
  300.   scrolling input pages, but can easily be added to inorder to support
  301.   additional pages. }
  302.  
  303. Begin   { HighlightSpecial_S_I_Prompts }
  304.   Case S_I_Page Of
  305.     1 : Begin
  306.           If CurrentLeftMostDataCol=1 Then
  307.             Begin
  308.               Window(LEFT_EDGE_OF_OUTER_SCROLL_WINDOW,
  309.                      TOP_EDGE_OF_OUTER_SCROLL_WINDOW,
  310.                      RightEdgeOfOuterScrollWindow,
  311.                      BOTTOM_EDGE_OF_OUTER_SCROLL_WINDOW);
  312.               TextColor(QuickInputHighlightColor);
  313.               TextBackground(InputWindowColor);
  314.               GotoXY(15,4);
  315.                 Write('I');
  316.               GotoXY(17,4);
  317.                 Write('C');
  318.               GotoXY(19,4);
  319.                 Write('D');
  320.               GotoXY(21,4);
  321.                 Write('L');
  322.             End; { If CurrentLeftMostDataCol }
  323.         End; { page 1 }
  324.     2 : Begin
  325.           If CurrentLeftMostDataCol=1 Then
  326.             Begin
  327.               Window(LEFT_EDGE_OF_OUTER_SCROLL_WINDOW,
  328.                      TOP_EDGE_OF_OUTER_SCROLL_WINDOW,
  329.                      RightEdgeOfOuterScrollWindow,
  330.                      BOTTOM_EDGE_OF_OUTER_SCROLL_WINDOW);
  331.               TextColor(QuickInputHighlightColor);
  332.               TextBackground(InputWindowColor);
  333.               GotoXY(15,4);
  334.                 Write('I');
  335.               GotoXY(17,4);
  336.                 Write('C');
  337.               GotoXY(19,4);
  338.                 Write('D');
  339.               GotoXY(21,4);
  340.                 Write('L');
  341.             End; { If CurrentLeftMostDataCol }
  342.         End; { page 2 }
  343.     3 : Begin
  344.           If CurrentLeftMostDataCol=1 Then
  345.             Begin
  346.               Window(LEFT_EDGE_OF_OUTER_SCROLL_WINDOW,
  347.                      TOP_EDGE_OF_OUTER_SCROLL_WINDOW,
  348.                      RightEdgeOfOuterScrollWindow,
  349.                      BOTTOM_EDGE_OF_OUTER_SCROLL_WINDOW);
  350.               TextColor(QuickInputHighlightColor);
  351.               TextBackground(InputWindowColor);
  352.               GotoXY(15,4);
  353.                 Write('I');
  354.               GotoXY(17,4);
  355.                 Write('C');
  356.               GotoXY(19,4);
  357.                 Write('D');
  358.               GotoXY(21,4);
  359.                 Write('L');
  360.             End; { If CurrentLeftMostDataCol }
  361.         End; { page 3 }
  362.     4 : Begin
  363.           If CurrentLeftMostDataCol=1 Then
  364.             Begin
  365.               Window(LEFT_EDGE_OF_OUTER_SCROLL_WINDOW,
  366.                      TOP_EDGE_OF_OUTER_SCROLL_WINDOW,
  367.                      RightEdgeOfOuterScrollWindow,
  368.                      BOTTOM_EDGE_OF_OUTER_SCROLL_WINDOW);
  369.               TextColor(QuickInputHighlightColor);
  370.               TextBackground(InputWindowColor);
  371.               GotoXY(15,4);
  372.                 Write('I');
  373.               GotoXY(17,4);
  374.                 Write('C');
  375.               GotoXY(19,4);
  376.                 Write('D');
  377.               GotoXY(21,4);
  378.                 Write('L');
  379.             End; { If CurrentLeftMostDataCol }
  380.         End; { page 4 }
  381.   End; { Case S_I_Page }
  382. End;    { HighlightSpecial_S_I_Prompts }
  383.  
  384.  
  385.  
  386. Procedure ShiftScrollWindowDataSidewaysModule(    NewInputCol,
  387.                                                   CurrentTopMostDataRow  :Integer;
  388.                                               Var CurrentLeftMostDataCol,
  389.                                                   CurrentRightMostDataCol:Integer);
  390.  
  391. { *************************************************************************** }
  392. { *                                                                         * }
  393. { *                SHIFT SCROLL WINDOW DATA SIDEWAYS MODULE                 * }
  394. { *                                                                         * }
  395. { *    This module is used by the procedures CurseLeft, CurseRight, and     * }
  396. { *    CarriageReturn.  This module shifts the data that is being displayed * }
  397. { *    in the scrolling window to the right or left, depending upon the     * }
  398. { *    value passed in NewInputCol.  Thus the scrolling window can scroll   * }
  399. { *    data sideways, acting like a viewport onto a spreadsheet.            * }
  400. { *                                                                         * }
  401. { *************************************************************************** }
  402.  
  403. Var
  404.   DataCol:Integer;                     { index variable to a screen column to be displayed on the screen }
  405.   OldLeftMostDataCol:Integer;          { an index to the previous left most data column }
  406.  
  407.  
  408.  
  409.   Procedure ShiftDataColHorizontally(    Column,
  410.                                          OldLeftMostDataCol,
  411.                                          NewLeftMostDataCol:Integer);
  412.  
  413.   { This procedure horizontally shifts the passed Column of data and
  414.     corresponding prompt from its previous position with respect to the passed
  415.     OldLeftMostDataCol to its new position with respect to the passed
  416.     NewLeftMostDataCol by moving portions of the video buffer to new locations
  417.     within the video buffer. }
  418.  
  419.   Var
  420.     ColorMonitorImage:Array[1..25,1..80,1..2] Of Char Absolute $B800:0000;
  421.       { an overlayed map of the color video memory addresses }
  422.     MonoMonitorImage:Array[1..25,1..80,1..2] Of Char Absolute $B000:0000;
  423.       { an overlayed map of the monochrome video memory addresses }
  424.     ScreenRow:Integer;                 { an index used in moving the data column }
  425.  
  426.   Begin   { ShiftDataColHorizontally }
  427.     If MonitorType=7 Then { monochrome adapter and monochrome monitor }
  428.       For ScreenRow:=TOP_EDGE_OF_OUTER_SCROLL_WINDOW+1 To BOTTOM_EDGE_OF_INNER_SCROLL_WINDOW Do
  429.         Move(MonoMonitorImage[ScreenRow,
  430.                               LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-OldLeftMostDataCol+1)*COL_WIDTH),
  431.                               1],
  432.              MonoMonitorImage[ScreenRow,
  433.                               LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-NewLeftMostDataCol+1)*COL_WIDTH),
  434.                               1],
  435.              COL_WIDTH*2-1)
  436.     Else { color or enhanced color adapter and color or monochrome monitor }
  437.       For ScreenRow:=TOP_EDGE_OF_OUTER_SCROLL_WINDOW+1 To BOTTOM_EDGE_OF_INNER_SCROLL_WINDOW Do
  438.         Move(ColorMonitorImage[ScreenRow,
  439.                                LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-OldLeftMostDataCol+1)*COL_WIDTH),
  440.                                1],
  441.              ColorMonitorImage[ScreenRow,
  442.                                LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-NewLeftMostDataCol+1)*COL_WIDTH),
  443.                                1],
  444.              COL_WIDTH*2-1);
  445.   End;    { ShiftDataColHorizontally }
  446.  
  447.  
  448.  
  449.   Procedure RemoveDataColPromptAndDataEntries(    Column:Integer);
  450.  
  451.   { This procedure removes the data column prompt (or descriptor) and its
  452.     corresponding data entries from the current scrolling window for the passed
  453.     Column index. }
  454.  
  455.   Begin   { RemoveDataColPromptAndDataEntries }
  456.     TextBackground(InputWindowColor);
  457.  
  458.     { remove data column prompt from scroll window }
  459.     Window(LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-CurrentLeftMostDataCol+1)*COL_WIDTH),
  460.            TOP_EDGE_OF_OUTER_SCROLL_WINDOW+1,
  461.            LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-CurrentLeftMostDataCol+1)*COL_WIDTH)+COL_WIDTH-1,
  462.            TOP_EDGE_OF_INNER_SCROLL_WINDOW-2);
  463.     ClrScr;
  464.  
  465.     { remove corresponding data entries from scroll window }
  466.     Window(LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-CurrentLeftMostDataCol+1)*COL_WIDTH),
  467.            TOP_EDGE_OF_INNER_SCROLL_WINDOW,
  468.            LEFT_EDGE_OF_INNER_SCROLL_WINDOW+((Column-CurrentLeftMostDataCol+1)*COL_WIDTH)+COL_WIDTH-1,
  469.            BOTTOM_EDGE_OF_INNER_SCROLL_WINDOW);
  470.     ClrScr;
  471.  
  472.   End;    { RemoveDataColPromptAndDataEntries }
  473.  
  474.  
  475.  
  476.   Procedure DisplayDataColPromptAndDataEntries(    Column:Integer);
  477.  
  478.   { This procedure displays the data column prompt (or descriptor) and
  479.     corresponding data entries in the current scrolling window for the passed
  480.     Column index. }
  481.  
  482.   Var
  483.     Row:Integer;                       { a counter index to a data row }
  484.  
  485.   Begin   { DisplayDataColPromptAndDataEntries }
  486.     TextColor(ForegroundColor);
  487.     TextBackground(InputWindowColor);
  488.  
  489.     { define portion of screen that column prompt is to be displayed in }
  490.     Window(LEFT_EDGE_OF_INNER_SCROLL_WINDOW,
  491.            TOP_EDGE_OF_OUTER_SCROLL_WINDOW+1,
  492.            RightEdgeOfInnerScrollWindow,
  493.            TOP_EDGE_OF_INNER_SCROLL_WINDOW-2);
  494.  
  495.     { display column prompt, this routine assumes that there are only three lines to each column heading }
  496.     GotoXY(((Column-CurrentLeftMostDataCol+1)*COL_WIDTH)+1,1);  { column prompt heading }
  497.       Write(S_I_Pages[S_I_Page].Prompts[Column+1].Prompt1);
  498.     GotoXY(((Column-CurrentLeftMostDataCol+1)*COL_WIDTH)+1,2);  { column prompt heading }
  499.       Write(S_I_Pages[S_I_Page].Prompts[Column+1].Prompt2);
  500.     GotoXY(((Column-CurrentLeftMostDataCol+1)*COL_WIDTH)+1,3);  { column prompt heading }
  501.       Write(S_I_Pages[S_I_Page].Prompts[Column+1].Prompt3);
  502.  
  503.     { define portion of screen that input data is to be displayed in }
  504.     Window(LEFT_EDGE_OF_INNER_SCROLL_WINDOW,
  505.            TOP_EDGE_OF_INNER_SCROLL_WINDOW,
  506.            RightEdgeOfInnerScrollWindow,
  507.            BOTTOM_EDGE_OF_INNER_SCROLL_WINDOW);
  508.  
  509.     { display corresponding column data }
  510.     For Row:=1 To (BOTTOM_EDGE_OF_INNER_SCROLL_WINDOW-TOP_EDGE_OF_INNER_SCROLL_WINDOW+1) Do
  511.       Begin
  512.         GotoXY(((Column-CurrentLeftMostDataCol+1)*COL_WIDTH)+1,Row); { goto front of data entry }
  513.         Write(S_I_Data[Column,(CurrentTopMostDataRow+Row-1),S_I_Page]^); { write data entry }
  514.       End; { For Row }
  515.  
  516.   End;    { DisplayDataColPromptAndDataEntries }
  517.  
  518.  
  519.  
  520. Begin   { ShiftScrollWindowDataSidewaysModule }
  521.   OldLeftMostDataCol:=CurrentLeftMostDataCol;
  522.  
  523.   { check for carriage return }
  524.   If NewInputCol=MAX_LEFT_COL Then
  525.     Begin { carriage return }
  526.       CurrentRightMostDataCol:=MAX_LEFT_COL+CurrentRightMostDataCol-CurrentLeftMostDataCol;
  527.       CurrentLeftMostDataCol:=MAX_LEFT_COL;
  528.       If OldLeftMostDataCol<=CurrentRightMostDataCol Then
  529.         Begin
  530.           For DataCol:=CurrentRightMostDataCol DownTo OldLeftMostDataCol Do
  531.             ShiftDataColHorizontally(DataCol,OldLeftMostDataCol,CurrentLeftMostDataCol);
  532.           For DataCol:=OldLeftMostDataCol-1 DownTo CurrentLeftMostDataCol Do
  533.             Begin
  534.               RemoveDataColPromptAndDataEntries(DataCol);
  535.               DisplayDataColPromptAndDataEntries(DataCol);
  536.             End; { For DataCol }
  537.         End { If OldLeftMostDataCol }
  538.       Else
  539.         For DataCol:=CurrentRightMostDataCol DownTo CurrentLeftMostDataCol Do
  540.           Begin
  541.             RemoveDataColPromptAndDataEntries(DataCol);
  542.             DisplayDataColPromptAndDataEntries(DataCol);
  543.           End; { Else }
  544.     End; { carriage return }
  545.  
  546.   { check for curse to the left }
  547.   If NewInputCol<CurrentLeftMostDataCol Then
  548.     Begin { curse left }
  549.       CurrentLeftMostDataCol:=NewInputCol;
  550.       CurrentRightMostDataCol:=CurrentRightMostDataCol-1;
  551.       For DataCol:=CurrentRightMostDataCol DownTo OldLeftMostDataCol Do
  552.         ShiftDataColHorizontally(DataCol,OldLeftMostDataCol,CurrentLeftMostDataCol);
  553.       RemoveDataColPromptAndDataEntries(CurrentLeftMostDataCol);
  554.       DisplayDataColPromptAndDataEntries(CurrentLeftMostDataCol);
  555.     End; { curse left }
  556.  
  557.   { check for curse to the right }
  558.   If NewInputCol>CurrentRightMostDataCol Then
  559.     Begin { curse right }
  560.       CurrentLeftMostDataCol:=CurrentLeftMostDataCol+1;
  561.       CurrentRightMostDataCol:=NewInputCol;
  562.       For DataCol:=CurrentLeftMostDataCol To CurrentRightMostDataCol-1 Do
  563.         ShiftDataColHorizontally(DataCol,OldLeftMostDataCol,CurrentLeftMostDataCol);
  564.       RemoveDataColPromptAndDataEntries(CurrentRightMostDataCol);
  565.       DisplayDataColPromptAndDataEntries(CurrentRightMostDataCol);
  566.     End; { curse right }
  567.  
  568. End;    { ShiftScrollWindowDataSidewaysModule }