home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / INTR_DMO.ZIP / STD-CTV.INC < prev    next >
Encoding:
Text File  |  1985-10-01  |  9.7 KB  |  218 lines

  1. { STD-CTV.INC General purpose global constants types and variables. }
  2.  
  3. const  ZERO        =  0;    { Used to clarify code.                     }
  4.        FILL_CHAR   = '_';   { Defines char. used to mark input fields.  }
  5.        SPACE       = ' ';   { Represents the ASCII space character, #32 }
  6.        NULL_STR    = '';    { Represents a null string.                 }
  7.  
  8. { Output Control Characters }
  9.        NULL_CHR    = #0;    { Null character.                }
  10.        BELL        = #7;    { Causes a beep when output to a }
  11.                             { terminal that has sound.       }
  12.        BS          = #8;    { Backspace.                     }
  13.        TAB         = #9;    { Tab character.                 }
  14.        LF          = #10;   { Line Feed.                     }
  15.        CR          = #13;   { Carriage Return.               }
  16.        FF          = #12;   { Form Feed.                     }
  17.        ESC         = #27;   { Escape character.              }
  18.        DEL         = #127;  { Rubout character.
  19.  
  20. { Video Limits & Locations }
  21.        MAX_ROW     = 25;      { Maximum number of rows for video.    }
  22.        MAX_COL     = 80;      { Maximum number of columns for video. }
  23.        MSG_LINE    = 23;      { Line to be used for user messages.   }
  24.        PROMPT_LINE = 24;      { Used for prompts, extended messages  }
  25.                               { and commands.                        }
  26.        CMD_LINE    = 25;      { Primary command input line.          }
  27.  
  28. { Input Control Keys:  Keyboard character code and video representation
  29.                        of keys used in Loan_Amortization application.
  30.                        Add others for general purpose use. The definitions
  31.                        shown will work on any Turbo supported system. The
  32.                        alternate definitions, which are commented out, will
  33.                        allow the IBM-PC and compatibles to use function and
  34.                        cursor control keys as indicated. }
  35.        BACKSP      = BS;           { Backspace or left arrow key.         }
  36.        BS_KEY      = #32#17#196#196#32;  { IBM-PC backspace key symbol.   }
  37.        ENTER       = CR;           { Return or Enter key.                 }
  38.        ENTER_KEY   = #32#17#196#217#32;  { IBM-PC enter key symbol.       }
  39.        CLEAR_FLD   = TAB;          { Forward tab key or ^I.               }
  40.        CLEAR_KEY   = #32#196#196#16#221#32; { IBM-PC tab key symbol.      }
  41.        ACCEPT      = #65;          { IBM-PC F7 key scan code              }
  42.        QUIT        = ESC;          { Escape key.                          }
  43.        ALT_INS     = #63;          { IBM F5 key scan code                 }
  44.        INS_CHAR    = #82;          { IBM insert key scan code.            }
  45.        ALT_DEL     = #64;          { IBM F6 key scan code                 }
  46.        DEL_CHAR    = #83;          { IBM delete key scan code.            }
  47.        CUR_RIGHT   = #77;          { IBM right arrow scan code.           }
  48.        ALT_RIGHT   = #62;          { IBM F4 scan code                     }
  49.        RIGHT_KEY   = #32#26#32;    { IBM right arrow key symbol.          }
  50.        CUR_LEFT    = #75;          { IBM left arrow scan code.            }
  51.        ALT_LEFT    = #61;          { IBM F3 scan code                     }
  52.        LEFT_KEY    = #32#27#32;    { IBM left arrow key symbol.           }
  53.        PREV_FLD    = #72;          { IBM up arrow key scan code.          }
  54.        ALT_PREV    = #59;          { IBM F1 key scan code.                }
  55.        PREV_KEY    = #32#24#32;    { IBM up arrow symbol.                 }
  56.        NEXT_FLD    = #80;          { IBM down arrow key scan code.        }
  57.        ALT_NEXT    = #60;          { IBM F2 key scan code.                }
  58.        NEXT_KEY    = #32#25#32;    { IBM down arrow symbol.               }
  59.        HELP        = #68;          { IBM F10 key scan code.               }
  60.        MSG_SWITCH  = #113;         { IBM <Alt> F10 scan code.             }
  61.        LEAD_IN     = ESC;          { Lead in char. for IBM function keys. }
  62.                                    { Change as needed for other systems.  }
  63.        ARROW      = #205#205#16#32;
  64.  
  65. { Prompt id constants }
  66.  
  67.        MSG_BOX_PROMPT = 0;
  68.        MENU_PROMPT    = 1;
  69.        HELP_PROMPT    = 2;
  70.        FLD_INP_PROMPT = 3;
  71.        ACCEPT_PROMPT  = 4;
  72.        ERROR_PROMPT   = 5;
  73.  
  74. { String types:  General purpose string types. }
  75. type   Str_2       = string[2];
  76.        Str_5       = string[5];
  77.        Str_10      = string[10];
  78.        Str_15      = string[15];
  79.        Str_20      = string[20];
  80.        Str_30      = string[30];
  81.        Str_40      = string[40];
  82.        Str_60      = string[60];
  83.        Str_80      = string[80];
  84.        Str_255     = string[255];
  85.        Drive_ID    = string[2];
  86.        File_ID     = string[64];
  87.  
  88. { Set types: }
  89.  
  90.        Any_Char       = set of Char;       { Defined set of all characters.  }
  91.        Printable_Char = set of ' '..'~';   { Set of printable characters.    }
  92.        Special_Char   = set of #128..#255; { Set of Non-standard characters. }
  93.        Control_Char   = set of #0..#127;   { Set of Control characters. This }
  94.                                            { includes DEL and the IBM-PC     }
  95.                                            { function key scan codes.        }
  96.  
  97. { Date types: }
  98.  
  99.       Byte_Date    = record
  100.                        year, month, day : Byte;
  101.                      end;
  102.  
  103.       Char_Date    = record
  104.                        year, month, day : Char;
  105.                      end;
  106.  
  107. var  default,                     { General purpose string buffer.         }
  108.      inp_str       : Str_80;      { Keyboard input string buffer.          }
  109.      i, j, k,                     { Misc. loop counter variables.          }
  110.      io_status     : Integer;     { Global status variable.                }
  111.      inctl,                       { Global control character.              }
  112.      inchr         : Char;        { Global input character.                }
  113.      output_id     : File_ID;     { Store ID of current output file/device.}
  114.      esc_flag,                    { Global logic control flags.            }
  115.      err_flag,
  116.      help_flag,
  117.      quit_flag,
  118.      end_session   : Boolean;
  119.  
  120.  
  121. { Additional global constants types and variables required if STD-INP.PAS
  122.   and/or STD-DISP.PAS will be used. }
  123.  
  124. const  MAX_FLD     = 40;  { Set maximum number of input fields permitted. }
  125.  
  126. { Field input type codes. }
  127.  
  128.        TEXT_FLD    = 'T';    { Text field. Used for screen doc. only. }
  129.        UC_TEXT     = 'U';    { Upper Case text field.                 }
  130.        NUMERIC     = 'N';    { Numeric field.                         }
  131.  
  132. { Field exit type codes. }
  133.  
  134.        REQUIRED    = 'R'; { Identifies field that requires an entry.       }
  135.        PROTECTED   = 'P'; { Identifies a field to be skipped during input. }
  136.        MANUAL      = ' '; { Manual exit field. User must press <CR>.       }
  137.        AUTOMATIC   = '-'; { Automatic exit after last char. is entered.    }
  138.  
  139.        INCR        = 1;     { INCR & DECR are used to set the }
  140.        DECR        = -1;    { direction indicator variable.   }
  141.  
  142. { Define data structure to hold input field parameters. }
  143.  
  144. type   Fld_Parms   = record
  145.                        xloc        : Byte;
  146.                        yloc        : Byte;
  147.                        fld_len     : Byte;
  148.                        fld_type    : Char;
  149.                        exit_type   : Char;
  150.                        inp_attr    : Byte;
  151.                        disp_attr   : Byte;
  152.                        msg_ptr     : Byte;
  153.                      end;
  154.  
  155.        Str_41      = string[41];
  156.  
  157.        Menu_Parms  = record
  158.                        xloc        : Byte;
  159.                        yloc        : Byte;
  160.                        menu_txt    : Str_41;
  161.                      end;
  162.  
  163.        PC_Char     = record
  164.                        character : Char;
  165.                        attribute : Byte;
  166.                       end;
  167.  
  168.        Field_Messages = array[1..40] of Str_60;
  169.  
  170.        RegPack     = record
  171.                        case Boolean of
  172.                          TRUE  : (ax,bx,cx,dx,bp,si,di,ds,es,flags : Integer);
  173.                          FALSE : (al,ah,bl,bh,clo,chi,dl,dh        : Byte);
  174.                      end;
  175.  
  176.        Scrn_Image  = array[1..2048] of Integer;
  177.        Inp_Scrns   = array[1..2] of Scrn_Image;
  178.        Inp_Scrn    = array[1..1760] of Integer;
  179.        Inp_Parm    = array[1..72] of Fld_Parms;
  180.        Menu_Parm   = array[1..15] of Menu_Parms;
  181.        Inp_Buf     = record
  182.                        buf_scrn    : Inp_scrn;
  183.                        buf_parm    : Inp_Parm;
  184.                      end;
  185.        Inp_Bufs    = array[1..2] of Inp_Buf;
  186.        Inp_Lines   = array[1..MAX_ROW,1..80] of Integer;
  187.  
  188.        File_Mode   = (ADD,UPDATE,DELETE);
  189.  
  190. var    image_file   : File of Scrn_Image;
  191.        vid_scrn     : Scrn_Image absolute VID_SEG:VID_OFFS;
  192.        vid_line     : Inp_Lines absolute vid_scrn;
  193.        vid_chr      : array[1..2000] of PC_Char absolute vid_scrn;
  194.        cur_scrn     : Inp_Scrn absolute vid_scrn;
  195.        usr_ptr      : array[1..2] of Integer absolute UsrOutPtr;
  196.        fld_dat      : Inp_Parm;
  197.        menu_dat     : Menu_Parm;
  198.        fld_msg      : Field_Messages;
  199.        prompt_dat,
  200.        menu_buf,
  201.        help_buf,
  202.        buf_scrn     : Inp_Scrn;
  203.        hold_vid     : Inp_Scrns;
  204.        vid_buf      : Inp_Bufs absolute hold_vid;
  205.        prompt_ln    : Inp_Lines absolute prompt_dat;
  206.        help_ln      : Inp_Lines absolute help_buf;
  207.        current_prg  : File_ID;
  208.        sys_date     : Str_10;
  209.        mode         : File_Mode;
  210.        fld_cnt,
  211.        cur_pos,
  212.        current_menu,
  213.        direction    : Integer;
  214.        accepted,
  215.        submenu,
  216.        modified,
  217.        msg_on       : Boolean;
  218.