home *** CD-ROM | disk | FTP | other *** search
- { TSIPP.PAS }
-
- { *************************************************************************** }
- { * * }
- { * TURBO SCREEN INPUT PRE-PROCESSOR TOOLKIT * }
- { * * }
- { * MAIN FILE * }
- { * * }
- { * Version 1.07 * }
- { * * }
- { * Written by Chris E. Maeder * }
- { * January, 1985 * }
- { * * }
- { * A few notes on notation: * }
- { * * }
- { * 'G_I' means General Input * }
- { * 'S_I' means Scrolling Input * }
- { * * }
- { * This file should be the one that you start compilation with. * }
- { * This file makes all of the include calls for the other files. * }
- { * All global constants, types, and variables that require defining * }
- { * in this file are defined here. All other global constants, * }
- { * types, and variables which you may find in the include files * }
- { * should remain in their respective include files. There is no * }
- { * need to transfer them to this file. * }
- { * * }
- { * These include files are modular in design. Thus you should * }
- { * exclude those from compilation that you do not need. For example, * }
- { * if your particular application of this pre-processor does not * }
- { * require scrolling input windows, then do not include the files * }
- { * 'S_Input1.Inc' and 'S_Input2.Inc'. * }
- { * * }
- { * Documentation on how the input pre-processor toolkit works can * }
- { * be found in the file 'Tsipp.Doc'. Further documentation can * }
- { * also be found in this file and the toolkit's other files. * }
- { * * }
- { *************************************************************************** }
-
-
-
- { Compiler Directives }
-
- {$C-} { This directive is required to guarantee that typed ahead characters will not be lost. }
-
-
-
- Const
-
- { Menu Subprogram Page Constant }
-
- MAX_NUM_OF_MENU_PAGES=1; { number of menu pages this particular implementation }
- { of the input pre-processor is required to support. }
-
-
-
- { General Input Subprogram Page Constant }
-
- MAX_NUM_OF_G_I_PAGES=1; { number of general input pages this particular }
- { implementation of the input pre-processor is }
- { required to support. }
-
-
-
- { Scrolling Input Subprogram Page Constant }
-
- MAX_NUM_OF_S_I_PAGES=4; { number of scrolling input pages this particular }
- { implementation of the input pre-processor is }
- { required to support. }
-
-
-
- { miscellaneous constants }
-
- TEXT_SCREEN_SIZE=4096; { size of the currently displayed video image in bytes }
-
- MAX_NUM_OF_TEXT_SCREENS=1; { maximum number of screen images that can be }
- { temporarily stored in the heap, as when displaying }
- { help screens. Can be increased so that more screen }
- { images can be temporarily stored in the heap. }
-
- INPUT_FILE_NAME_EXTENSION:String[4]='.INP'; { three character extension to the input data file }
- { names. Note that the Constant makes it easy for more }
- { than one application of the pre-processor to exist in }
- { the same directory. }
-
- TEMPLATE_FILE_NAME_EXTENSION='.TPL'; { three character extension to particular applications }
- { template file names. Note that the Constant makes it easy }
- { for more than one application of the pre-processor }
- { to exist in the same directory. }
-
-
-
- Type
-
- { Page Control Type }
-
- PageType=(Menu,G_I,S_I,Exit); { enumerated data type used to tell the main subprogram which }
- { of the below page type subprogram is currently in }
- { control: }
- { Menu Subprogram }
- { General Input Subprogram }
- { Scrolling Input Subprogram }
- { Exit back to the operating system }
-
-
-
- { Menu Subprogram Page Type }
-
- MenuPageType=1..MAX_NUM_OF_MENU_PAGES; { a data type for the variable MenuPage }
-
-
-
- { General Input Subprogram Page Type }
-
- G_I_PageType=1..MAX_NUM_OF_G_I_PAGES; { a data type for the variable G_I_Page }
-
-
-
- { Scrolling Input Subprogram Page Type }
-
- S_I_PageType=1..MAX_NUM_OF_S_I_PAGES; { a data type for the variable S_I_Page }
-
-
-
- { Storage Data Structure for Screen Images }
-
- TextScreenPtr=^TextScreenImage; { pointer to a screen image stored in the heap }
- TextScreenImage= { a record type used to store a particular screen image }
- Record
- Image:Array[1..TEXT_SCREEN_SIZE] of Byte;
- End; { TextScreenImage }
-
-
-
- { Screen Color Data Type }
-
- ColorType=0..31; { enumerated data type for allowable screen colors }
-
-
-
- { Miscellaneous Data Types }
-
- WorkString=String[79]; { a text string type used for passing text between }
- { procedures }
-
-
-
- Var
-
- { Page Control Variable }
-
- CurrentPage:PageType; { a variable used to tell the main subprogram what }
- { page subprogram is currently under control }
-
-
-
- { Menu Subprogram Page Variable }
-
- MenuPage: { an index to the current menu page being displayed }
- MenuPageType;
-
-
-
- { General Input Subprogram Page Variable }
-
- G_I_Page: { an index to the current general input page being }
- G_I_PageType; { displayed }
-
-
-
- { Scrolling Input Subprogram Page Variable }
-
- S_I_Page: { an index to the current scrolling input page }
- S_I_PageType; { being displayed }
-
-
-
- { Temporary Storage Variable for Screen Images }
-
- TextScreen:Array[1..MAX_NUM_OF_TEXT_SCREENS] of TextScreenPtr; { an array of pointers which point to various }
- { screen images that are being stored temporarily }
- { in the heap, as when displaying a help screen }
-
-
-
- { Screen Color Variables}
-
- HighlightColor:ColorType; { Highlight prompt }
- BackgroundColor:ColorType; { Normal background color }
- ForegroundColor:ColorType; { Normal foreground color }
- CharacterInputColor:ColorType; { Color of characters being inputed }
- BlockBackgroundColor:ColorType; { Color of highlighted input block background }
- BlockForegroundColor:ColorType; { Color of highlighted input block foreground }
- QuickInputHighlightColor:ColorType;{ Color of special 1 or 2 character input prompts }
- InputWindowColor:ColorType; { Color of load input box background }
- ErrorWindowColor:ColorType; { Color of error message box background }
- InputWindowBorderColor:ColorType; { Color of special input box border color }
- MenuBackgroundColor:ColorType; { Color of main menu screen background }
-
-
-
- { Forward Procedure Declarations }
-
- Procedure DrawSimpleBeam;Forward; { procedure specific to example application of pre-processor }
-
- Procedure DisplayBeamLength;Forward; { procedure specific to example application of pre-processor }
-
- Procedure DisplayBeamLoadModule( CurrentInputCol,
- CurrentInputRow:Integer);Forward;
-
- Procedure G_I_ErrorCheckingModule(Var OldPrompt,
- NewPrompt:Integer;
- Var DataEntry:Workstring);Forward;
-
- Procedure S_I_ErrorCheckingModule(Var OldCol :Integer;
- OldRow :Integer;
- Var NewCol :Integer;
- NewRow,
- CurrentTopMostDataRow :Integer;
- Var CurrentLeftMostDataCol,
- CurrentRightMostDataCol:Integer;
- Var DataEntry :Workstring);Forward;
-
- Procedure LabelNewFile;Forward;
-
- Procedure RemoveNewFileLabel;Forward;
-
- Procedure ReadInputFileModule;Forward;
-
- Procedure WriteInputFileModule(Var ReturnToMainModule:Boolean);Forward;
-
- Procedure DirectoryModule;Forward;
-
-
-
- { Compiler File Include Directives }
-
- {$I Screen.Inc}
- {$I Menu.Inc}
- {$I Execute.Inc}
- {$I G_Input.Inc}
- {$I S_Input1.Inc}
- {$I S_Input2.Inc}
- {$I Display.Inc}
- {$I Init.Inc}
- {$I Error.Inc}
- {$I File.Inc}
-
-
-
- Procedure ProgramPageControl;
-
- { This procedure controls the display and the user interaction with the
- pre-processor program's menu pages, general input pages, and scrolling input
- pages. This procedure is executed whenever a new page is displayed, even
- if the same module will control the user interaction with the new page. }
-
- Begin { ProgramPageControl }
- Case CurrentPage Of
- Menu : Begin
- MenuModule;
- End; { Menu Module }
- G_I : Begin
- G_I_EntryModule;
- End; { General Input Page Module }
- S_I : Begin
- S_I_EntryModule;
- End; { Scrolling Input Page Module }
- End; { Case CurrentPage }
- End; { ProgramPageControl }
-
-
-
- Procedure ShutProgramDown;
-
- { This procedure causes the program to halt. In doing so this procedure:
-
- 1. Releases all the dynamic memory previously allocated to the program
- back to the operating system.
- 2. Resets the blinking cursor.
- 3. Resets the screen's foreground and background colors.
- 4. Clears the screen. }
-
- Begin { ShutProgramDown }
- Window(1,1,80,25);
- ShowBlinkingCursor;
- TextColor(ForegroundColor);
- TextBackground(Black);
- ClrScr;
- DisposeOfMenuDynamicMemory;
- DisposeOf_G_I_DynamicMemory;
- DisposeOf_S_I_DynamicMemory;
- Halt;
- End; { ShutProgramDown }
-
-
-
- Begin { Main Program }
- InitModule;
- Repeat
- ProgramPageControl;
- Until CurrentPage=Exit;
- ShutProgramDown;
- End. { Main Program }