home *** CD-ROM | disk | FTP | other *** search
- { STD-CTV.INC General purpose global constants types and variables. }
-
- const ZERO = 0; { Used to clarify code. }
- FILL_CHAR = '_'; { Defines char. used to mark input fields. }
- SPACE = ' '; { Represents the ASCII space character, #32 }
- NULL_STR = ''; { Represents a null string. }
-
- { Output Control Characters }
- NULL_CHR = #0; { Null character. }
- BELL = #7; { Causes a beep when output to a }
- { terminal that has sound. }
- BS = #8; { Backspace. }
- TAB = #9; { Tab character. }
- LF = #10; { Line Feed. }
- CR = #13; { Carriage Return. }
- FF = #12; { Form Feed. }
- ESC = #27; { Escape character. }
- DEL = #127; { Rubout character.
-
- { Video Limits & Locations }
- MAX_ROW = 25; { Maximum number of rows for video. }
- MAX_COL = 80; { Maximum number of columns for video. }
- MSG_LINE = 23; { Line to be used for user messages. }
- PROMPT_LINE = 24; { Used for prompts, extended messages }
- { and commands. }
- CMD_LINE = 25; { Primary command input line. }
-
- { Input Control Keys: Keyboard character code and video representation
- of keys used in Loan_Amortization application.
- Add others for general purpose use. The definitions
- shown will work on any Turbo supported system. The
- alternate definitions, which are commented out, will
- allow the IBM-PC and compatibles to use function and
- cursor control keys as indicated. }
- BACKSP = BS; { Backspace or left arrow key. }
- BS_KEY = #32#17#196#196#32; { IBM-PC backspace key symbol. }
- ENTER = CR; { Return or Enter key. }
- ENTER_KEY = #32#17#196#217#32; { IBM-PC enter key symbol. }
- CLEAR_FLD = TAB; { Forward tab key or ^I. }
- CLEAR_KEY = #32#196#196#16#221#32; { IBM-PC tab key symbol. }
- ACCEPT = #65; { IBM-PC F7 key scan code }
- QUIT = ESC; { Escape key. }
- ALT_INS = #63; { IBM F5 key scan code }
- INS_CHAR = #82; { IBM insert key scan code. }
- ALT_DEL = #64; { IBM F6 key scan code }
- DEL_CHAR = #83; { IBM delete key scan code. }
- CUR_RIGHT = #77; { IBM right arrow scan code. }
- ALT_RIGHT = #62; { IBM F4 scan code }
- RIGHT_KEY = #32#26#32; { IBM right arrow key symbol. }
- CUR_LEFT = #75; { IBM left arrow scan code. }
- ALT_LEFT = #61; { IBM F3 scan code }
- LEFT_KEY = #32#27#32; { IBM left arrow key symbol. }
- PREV_FLD = #72; { IBM up arrow key scan code. }
- ALT_PREV = #59; { IBM F1 key scan code. }
- PREV_KEY = #32#24#32; { IBM up arrow symbol. }
- NEXT_FLD = #80; { IBM down arrow key scan code. }
- ALT_NEXT = #60; { IBM F2 key scan code. }
- NEXT_KEY = #32#25#32; { IBM down arrow symbol. }
- HELP = #68; { IBM F10 key scan code. }
- MSG_SWITCH = #113; { IBM <Alt> F10 scan code. }
- LEAD_IN = ESC; { Lead in char. for IBM function keys. }
- { Change as needed for other systems. }
- ARROW = #205#205#16#32;
-
- { Prompt id constants }
-
- MSG_BOX_PROMPT = 0;
- MENU_PROMPT = 1;
- HELP_PROMPT = 2;
- FLD_INP_PROMPT = 3;
- ACCEPT_PROMPT = 4;
- ERROR_PROMPT = 5;
-
- { String types: General purpose string types. }
- type Str_2 = string[2];
- Str_5 = string[5];
- Str_10 = string[10];
- Str_15 = string[15];
- Str_20 = string[20];
- Str_30 = string[30];
- Str_40 = string[40];
- Str_60 = string[60];
- Str_80 = string[80];
- Str_255 = string[255];
- Drive_ID = string[2];
- File_ID = string[64];
-
- { Set types: }
-
- Any_Char = set of Char; { Defined set of all characters. }
- Printable_Char = set of ' '..'~'; { Set of printable characters. }
- Special_Char = set of #128..#255; { Set of Non-standard characters. }
- Control_Char = set of #0..#127; { Set of Control characters. This }
- { includes DEL and the IBM-PC }
- { function key scan codes. }
-
- { Date types: }
-
- Byte_Date = record
- year, month, day : Byte;
- end;
-
- Char_Date = record
- year, month, day : Char;
- end;
-
- var default, { General purpose string buffer. }
- inp_str : Str_80; { Keyboard input string buffer. }
- i, j, k, { Misc. loop counter variables. }
- io_status : Integer; { Global status variable. }
- inctl, { Global control character. }
- inchr : Char; { Global input character. }
- output_id : File_ID; { Store ID of current output file/device.}
- esc_flag, { Global logic control flags. }
- err_flag,
- help_flag,
- quit_flag,
- end_session : Boolean;
-
-
- { Additional global constants types and variables required if STD-INP.PAS
- and/or STD-DISP.PAS will be used. }
-
- const MAX_FLD = 40; { Set maximum number of input fields permitted. }
-
- { Field input type codes. }
-
- TEXT_FLD = 'T'; { Text field. Used for screen doc. only. }
- UC_TEXT = 'U'; { Upper Case text field. }
- NUMERIC = 'N'; { Numeric field. }
-
- { Field exit type codes. }
-
- REQUIRED = 'R'; { Identifies field that requires an entry. }
- PROTECTED = 'P'; { Identifies a field to be skipped during input. }
- MANUAL = ' '; { Manual exit field. User must press <CR>. }
- AUTOMATIC = '-'; { Automatic exit after last char. is entered. }
-
- INCR = 1; { INCR & DECR are used to set the }
- DECR = -1; { direction indicator variable. }
-
- { Define data structure to hold input field parameters. }
-
- type Fld_Parms = record
- xloc : Byte;
- yloc : Byte;
- fld_len : Byte;
- fld_type : Char;
- exit_type : Char;
- inp_attr : Byte;
- disp_attr : Byte;
- msg_ptr : Byte;
- end;
-
- Str_41 = string[41];
-
- Menu_Parms = record
- xloc : Byte;
- yloc : Byte;
- menu_txt : Str_41;
- end;
-
- PC_Char = record
- character : Char;
- attribute : Byte;
- end;
-
- Field_Messages = array[1..40] of Str_60;
-
- RegPack = record
- case Boolean of
- TRUE : (ax,bx,cx,dx,bp,si,di,ds,es,flags : Integer);
- FALSE : (al,ah,bl,bh,clo,chi,dl,dh : Byte);
- end;
-
- Scrn_Image = array[1..2048] of Integer;
- Inp_Scrns = array[1..2] of Scrn_Image;
- Inp_Scrn = array[1..1760] of Integer;
- Inp_Parm = array[1..72] of Fld_Parms;
- Menu_Parm = array[1..15] of Menu_Parms;
- Inp_Buf = record
- buf_scrn : Inp_scrn;
- buf_parm : Inp_Parm;
- end;
- Inp_Bufs = array[1..2] of Inp_Buf;
- Inp_Lines = array[1..MAX_ROW,1..80] of Integer;
-
- File_Mode = (ADD,UPDATE,DELETE);
-
- var image_file : File of Scrn_Image;
- vid_scrn : Scrn_Image absolute VID_SEG:VID_OFFS;
- vid_line : Inp_Lines absolute vid_scrn;
- vid_chr : array[1..2000] of PC_Char absolute vid_scrn;
- cur_scrn : Inp_Scrn absolute vid_scrn;
- usr_ptr : array[1..2] of Integer absolute UsrOutPtr;
- fld_dat : Inp_Parm;
- menu_dat : Menu_Parm;
- fld_msg : Field_Messages;
- prompt_dat,
- menu_buf,
- help_buf,
- buf_scrn : Inp_Scrn;
- hold_vid : Inp_Scrns;
- vid_buf : Inp_Bufs absolute hold_vid;
- prompt_ln : Inp_Lines absolute prompt_dat;
- help_ln : Inp_Lines absolute help_buf;
- current_prg : File_ID;
- sys_date : Str_10;
- mode : File_Mode;
- fld_cnt,
- cur_pos,
- current_menu,
- direction : Integer;
- accepted,
- submenu,
- modified,
- msg_on : Boolean;