IMD 1.18: 15/07/2013 8:41:26 turbo pascal tutor source disk   D@`  @`! #@%`')+-/1 3@5`79;=?A C@E`GIKMOQS@U`WY[]_/c@e`gikmoq s@u`wy{} @` @ ` `  @ ` @ ` ǀ ɠ @ ` ׀ ٠  @`@`  @`! #@%`')+-/1 3@5`79;=?A C@E`GIKMOQS@U`WY[]_/c@e`gikmoq s@u`wy{} @` @ ` `  @ ` @ ` ǀ ɠ @ ` ׀ ٠  @`README COM9TUTORINSCOMeTUTORINSDTARTUTORINSMSG\TUTOR PASa:WINDOW INCQUIZ INCDISPLAY INCTSCROLL INC$TUTOR LIB.README > r)ͫCopyright (C) 1985 BORLAND IncT?0No Terminal selectedP.' tC.P_XuËCKu.&2P2 XHur!.PSr.[XPSPSPS[XÜPSPS[Xûm릻} dPSQRVW..FFGG..#..,.=_^ZY[Xÿ2.t.OOK2.v t0.G u[_)PQYX%;u;&E&]P X[S>r3$ȋ >t%s > &=st +%6&=T`njfhQRȋӋČӃ_3hZYw 33SP&u&5njT&&E&E&E6 &<&D6&<&DÑ[_[S& &U u r3$ >njsW&&]s6 6&&\&D&D& &U&E&]<t&=&E&]& &U&&&]ȋӡ &E&]njBMuQfhAt1&&\&L&T&&] &E&]3É>fhW3_3333>t&=ČӃ3+hr;sȋ[f&h&U[&=>f>h3>>pu2>qu+tȀu tq&p%Ltpp u qq>ru<u2XZPRt5>ruLwt L<uLXXZPXZP 2=tt3tHU!]VQ6VX<t FFY^Yr^QV6VX9uFF^Y븋6VX t >FF3P>VX3#P5r3p\^`]~ %,Ë$,4CSQRWV2P^_ZY[SQRWVLU^.C t^] _.u Ȏ+شJ.DR.DT..LQVR^Y><.D> t 8:>H.DJ t DFV5ln KPt ;PtrZ 3dt>8%JDô03 tú> ,  T Not enough memory$Incorrect DOS version$ Program aborted $P8D%lXPuL6R&:PT[. t53ҋ tSB[;t +NOJu^.;uPRVt2 tGW t:t \t\GFF.FG u=t_^Zr).B2Ί2Yr?Tr>늲V[RSt L[YSЊ t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revised 10/02/85READMEUUV P P P} Ps Pi P_ PU PK PA P7 P- P# P P P P P P P P P P P P Pv]UULLP~WY+}.AFQ~FW~F&2_&YItF]UUL u(~]UUnP~ qQ3]QUUUvUL{}. Reading text.^x WZPF`=? Reading line#F߸d^6UK4Pd=:|HY#P24Y# u\dd^6UdQᗁǹP'xwߡd=t PdPKw PdP.ߋ^6U4uqh_y 4uLLN"-- Sorry, this program only reads :P} lines of text.#޹]]ùDw0Borland International: Read a Text File Program.:*߸'G$pgi Looking for ~߸~UW~~U=u%Wz -- FILE NOT FOUNDP. Ugd=|&WAݿ*:P FILE EMPTYZP]UUUNUvU UvvULLF2 u|~޸=!f P P~m]SUvvULL,9Aܿ,, *f| Notes߸ ܋^6G2=At-,H Page FP]ܿ, fFܸP* NotesY+}#AFQ,w=P YItF,Yaۿ,LTۋFPFY+}^AFQOuq^6G_, p FQᗁǹ<ݸYItF, P`۸ ^6GX]_Printing . . .PIݸPFF;F~PF2=tHY u0C_Printing . . .PܸPrF2;F!`ڋFPFPFPFF$?ڋFPF2PFPF2FFFJ_%Printing . . .PiܸP]UvULLFPFY+}|AFQuE(0^ 6Lً^6G2P޸޸ut rFQǹ[۸YItFF+FP-Y+}AFQoYItF\K===========================================================================sًF=tHPF;dtHY# uV,.I exit

print page print all [ END OF TEXT ]%F=HPF;d|HY# uXK exit

print page print all page down page upF=tIOQ<<ESC> exit

print page print all page downUK exit

print page print all  page upe׸ ^6GX]UvULL~&P-Y;d~S~W~&P-Y_&~&P-YFF;ddF~&PFP]UvULL~&=k~W~&P-Y+_&~&=| ~&~&P-YFF;ddF~&PFP ]UvU ^6G^6G]ÃFP-Y;d|ՋFPFP-YPtՋFPdPF2Pڸڸs4u4(~ՊF2Pmڸ y sCu FF2Z=t&WINTERRUPTED . . .PWP=tuo F.= tԍ~W=tԍ~W=PtFP-Y;d|hԋFPFP-YPBJԋFPdP.FP-Y;d|#ԋFPFP-YP&ԋFPdPg=AtYӸPdPFP-Y;d|ӋFPFP-Y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gދ^6x:M=uHW6File Containing messages for this program is not foundP߹݋^6xWeP^6Ws l݋^6W Y݋^6NW F݋^6'Ws 3݋^6W` ݋^6WMW^62費_^6Aƹ ܋^6WW^62聻_^6Aƹ ܋^6[W ܋^6W ܋^6W ܋^64W r܋^6W]UvU^6(W B܋^6AWo^6G‹^6G24uӋ^6A׸ Pyn܋^6G2 u9~\ָ PL֋^6'ָ P0%ܹ ~HP ۋ^6W^66F^6m P^6G2Y u8^6G‹^6<Ru~W^6IP^6uP^6u$~}W~W~HP4~&E}2=tH^6G ڋ^6W^6G2 uU~W_&E}ы^6gYո PڹbK~W~HP2(~W_&E}~W/? ٸPP^6uP^6u$~~W~&W~HP~&E~2=tH^6G }ً^6W^6G2 uU~W_&E~Ћ^6G9Ը Pٹb+~&W~HP(~W_&E~~&W ظPP^6ub~ǀW~HPX~ǀ菽襽FF ˸PFF2 u P~ԳP P~诲³Y u~W2()˹ ˸ P~buu*sjľWPPPW I P~,u* !ľW'  XX ɸP~WFk^ʍ~p(LʊF2 u]ɍ~WN軮P-FPo~0WľW(WľWľ芮贮ľWľ&E{2_&EľWľ&E|2_&EľWľHrľWľ&/Yľ Wľ6@ľWľ&EF2_&E0ľWľ&EI2_&E1ľWľ&EJ2_&E2ľWľ&EG2_&E3ľWľ&EH2_&E4ľWľ&EK_&E5ľ7WľM{襭ľ=WľSb茭ľCWľoIsľIWľu0ZľWľ&EY_&EOľQWľi-ľWWľ[ꬱľ]WľaѬľWľ&Eg_&EcXXXXXXF2 uj~y2 ]©UUWcW]UU]TǿcWFPWD蹾<.]UUǿcWW胾o]UUƋFPuUK]UUF[WPP辬Copy賬PʫW&菫ƿW=u2Wj胫File &]mp not found\P軫ȹ8LW[.蠫WWJ4uHW %You cannot install & with this program諱PGȿW~&n-=u:W蹪 Message file ~&苪蛫螪 not found芫Pǡ PY =ſWF2 ]UUUvUPFFP~蔫Y;~~WF_&2=t_~WFP ~W_W~W_&2@_&~W~螩/_W~WF_&2_&F@Fg]PPY+}AFQɻ苿YItFWT  PdPY+}^AFQ蓻UĹĿcWFPWʹÿWWWڨ̾CYItF: P4)]UUL뺍~ϼ ĊF2AFF2= |F2P@YFF2P_=uǺ艾ÊF2P:ةFF]UU L&P腨~&Py   視 骹(WDu¿WWPPP]UUPY+}AQܹ螽YItL¿cWP00QᗍW.ɸ1P5Y+}5AQ¿cW20QᗍWYItPQG¸0P5Y+}LAQ22P)Ѽ) 20Qᗍ萦肼¼YIt讼gP覸艺2PU0P5dWQQqKu2P'0P56uuWľ0W20Qᗍᥱ ľW20.b2_&EHWWPPPY+@PXX]UUP zWaøPZhZW~:F=uHPZ=tHY uPZ]ù#LIu cW P\Wƹ뿿cWePWƹԿWWPPPŹ赿 謿P=tV2=t 荿e:=t y&Wm膤Unknown Video devicePʤ=t <W& ul ADDS 20/25/300PY  KPY ADDS 40/600PY  KMlPYADDS Viewpoint-1A0AY  KPYADM 3A= )(P= Ampex D80= )(TER(=ANSI;1mmP[;HBeehive (DM1, DM10) F000 EHKPFKBeehive (Euro FT-10)F EKLMPF DEC RainbowP[;HHazeltine 1500~~~~~~~P~HP 150 &s1A&jS &s0A&jR &a00c00YJ&d@&dHKLMQ&acYIBM DisplaywriterY L33IPQPY Kay pro +88 4 and 10= /-C1B1REP=Lear-Siegler ADM-20= )(TERP=Lear-Siegler ADM-31= *)(TERP=Liberty= )(TERP= Morrow MDT-20= )(TERP=Northstar Advantage= LMP=Otrona AttacheP[;HQume= )(TERP= RC-855 (ITT)  P Soroc IQ-120 (and up= *)(TP=Soroc new models= *)(TERP=SSM-UB300;002J1;17U0UKLMP;Tandberg TDV 2215P Teletex 3000= )(T-ERP=Televideo 912/920/92= )(TERP=Texas Instrument Pro3mP[;H Visual 200Y v34xLMPYWyse WY-100/200/300= )(TERP=Zenith, Victor 900000Cur[, Morrow Y0 EqpKLMPPYKLM 1 Turbo Pascal general installation System 2 Choose installation item from the following: 3 4 Screen installation | Quit 5 6 Enter S or Q: 13 -> 101 Nothing ^Q: Quit, ^R: Last page, ^C: Next page, : Select terminal: Wait Sorting Definitions Change to: (Y/N)? y n Text file name: Command: Numeric entry expected Legal range is , please re-enter: Choose one of the following terminals: None of the above ( Max. 20 Characters ) Delete a definition ( Max. 20 Characters ) Which terminal? (Enter no. or ^Q to exit): Delete terminal? (Enter no. or ^Q to exit): Do you want to modify this definition before installation?  Terminal type: Send an initialization string to the terminal? Initializaion defined as a command string? (No = a file) Send a reset string to the terminal Reset defined as a command? (No = a file) CURSOR LEAD-IN command: CURSOR POSITIONING COMMAND to send between line and column: CURSOR POSITIONING COMMAND to send after both line and column: Column first OFFSET to add to LINE: OFFSET to add to COLUMN: Binary address Number of ASCII digits (2 or 3): CLEAR SCREEN command:  Does CLEAR SCREEN also HOME cursor HOME command: DELETE LINE command: INSERT LINE command: ERASE TO END OF LINE command: START HIGHLIGHTING command: END HIGHLIGHTING command: Number of rows (lines) on your screen: Number of columns on your screen: Delay after CURSOR ADDRESS (0-255 ms): Delay after CLEAR, DELETE and INSERT (0-255 ms): Delay after ERASE TO END OF LINE and HIGHLIGHT (0-255 ms): Is this definition correct?  Hardware dependent information Operating frequency of your microprocessor in MHz (for delays): 101 Nothing 200 Choose one of the following displays: 201 Which display? (Enter no. or Q to exit): 202 Default display mode 203 Monochrome display 204 Color display 80x25 205 Color display 40x25 206 b/w display 80x25 207 b/w display 40x25 {$C-,K-,A-} { Turn off Ctrl-C, stack checking, enable absolute code generation } program TurboTutor; { --------------------------------------------------------------------------- TURBO PASCAL TUTOR Version 2.0 Copyright (c) 1986 by Borland International, INC. DESCRIPTION This program is a "shell" that runs example sub-programs for the Turbo Pascal Tutor. To run this program, get to the DOS prompt, type TUTOR and hit . SYSTEM REQUIREMENTS  Turbo Pascal : Version 3.0 Hardware : Any computer that runs MS-DOS Turbo Pascal version 3.0 Operating systems: MS-DOS 2.0 or later Memory : 192K main memory COMPILING THE TUTOR TUTOR.COM comes already compiled on  disk 1 of the Turbo Pascal Tutor. If you wish to re-compile TUTOR.PAS, log onto the the disk drive containing disk 1, load the Turbo Pascal compiler and specify this file as the MAIN program. Type "R" to compile and run the shell. For more information about compiling TUTOR.PAS, please refer to chapter 1 of the Tutor manual. USING THE TUTOR When you load TUTOR, a menu of topics will display. Select a topic to study by using the instructions displayed at the bottom of the main menu screen. You can select, run, and take a quiz on each tutor example. MODIFYING THE EXAMPLES To make modifications to one of the examples, e.g. INTEGERS.EX, do the following: 1) Copy INTEGERS.EX to a new file, INTEGERS.PAS 2) Load Turbo Pascal, type "W" and specify INTEGERS as the work file you wish to modify. 3) Use the Turbo Pascal editor to make your changes to the program's source. Follow the instructions at the bottom of the file in order to modify the example to make it a standalone program; this will enable you to compile and test your changes without modifying the original tutor program. 3) Test your modifications by exiting from the editor and typing "R". PROGRAM OVERVIEW Source code is provided for every part of the tutor program. There more than 20 sample topics selectable via the main menu. TUTOR.PAS Contains the routines that manage all the examples WINDOW.INC Contains the routines that manage the windows QUIZ.INC Contains the routines that present the quiz DISPLAY.INC Contains the routines that manage the display TSCROLL.INC Contains the routines that scroll source text in a window TUTOR.LIB Contains routines used by many of the examples .EX files Each contain an example. The name of each .EX file is stored in the global array (a typed constant), Examples. The source code to the first example, INTEGERS, is stored in a text file called, INTEGERS.EX. The first part of the file name, INTEGERS, is displayed on the main menu. The  name of the procedure is also INTEGERS, and when it is selected on the main menu, the procedure is invoked by procedure RunExample. QUIZ.DTA Contains the quiz questions for each topic. TUTOR.HLP Contains one page of introductory text for TUTOR ----------------------------------------------------------------------------- } const Version = '2.00'; { displayed by LogOn screen } OperatingSystem = 'MS-DOS'; { The name of the operating system } DividingLine = 12; { y coord. of border between upper & lower windows } MaxExamples = 21; { total # of .EX files, menu selections } LastAnswer = 'D'; { Answers A..D } QuizFileName = 'QUIZ.DTA'; type ExampleStr = string[8]; { .EX file name } NameStr = string[14]; { for file names } FileNames = array[1..MaxExamples] of ExampleStr; { list of examples } QuestionStr = string[70]; { sized according to actual data } AnswerStr = string[66]; { " } HintStr = string[72]; { " } QuizRec = record { Each question is represented by this record } TopicNumber : integer; { c orresponds w/ Selection# in Examples } Question : QuestionStr; { the actual question } Choices : array['A'..LastAnswer] of { answer choices } AnswerStr; Solution : char; { A..LastAnswer }  Hint : HintStr; { an optional hint or tip } end; QuizFileType = file of QuizRec; QuizStatusRec = record { Contains relevant quiz file vars } QuizFile : QuizFileType; { file variable } QuizIndex : { 1st rec# for each topic } array[1..MaxExamples] of integer; FileOpened : boolean; { flag } end; var InstallString : string[20] absolute CSeg:$155; { The string that holds the name of the installed terminal } QuizStatus : QuizStatusRec; { contains all relevant quiz vars } {$I TUTOR.LIB } const { WINDOW DEFINITIONS: } LogOnWindow : WindowRec = (X : 1; Y : 1; { Log on screen } Height : 6;  Width : 38; CurrColor : HiColor); UpperWindow : WindowRec = (X : 1; Y : 2; { upper half } Height : 10; Width : 80;  CurrColor : HiColor); LowerWindow : WindowRec = (X : 1; Y : 13; { lower half } Height : 11; Width : 80; CurrColor : HiColor); { Each string in this array serves two functions: 1. It is the title displayed on the examples menu 2. It is the first half of the file name on disk associated with that example. In addition, the example procedure has the same name (although Pascal will not allow a program to pass a string variable in order to invoke an internal procedure). Example: INTEGERS ( as it appears on main menu ) INTEGERS.EX ( disk file containing source  code for this example ) procedure Integers; ( as declared in INTEGERS.EX )  1 : Integers; ( as invoked by procedure RunExample ) } Examples : FileNames = ('INTEGERS', 'CHARS', 'BINARY', 'HEX', 'IFCASE', 'FORDO', 'WHILEDO', 'REPUNTIL', 'REALS', 'SCALARS', 'SETS1', 'SETS2', 'STRINGS1', 'STRINGS2', 'ARRAYS1', 'ARRAYS2', 'RECFILES', 'WRITTEXT', 'READTEXT',  'STACK', 'RECUR'); { =============== MISC UTILITIES ================== } var Selection : integer; ExampleRun : boolean; { A flag to keep track of whether or not a selected example was run yet - used to position the quiz } {$I WINDOW.INC } { include file with window routines } {$I TSCROLL.INC } { include file that lets user scroll  } { through source text in lower window } const ULcorner = '+'; URcorner = '+'; { ASCII box chars } LLcorner = '+'; LRcorner = '+'; AcrossCh = '-'; DownCh = '|'; procedure DrawBox(X1, Y1, X2, Y2 : byte); forward; { Each of the following include files demonstrates a different TUTOR example topic. Each file is a procedure that is invoked b y the control routine, RunExample. Each .EX file may also be run as a stand-alone program--to do so, please make a copy of the .EX file you wish to run (so as not to destroy the original) and load the copy into the Turbo Pascal editor. Edit the file and follow the instructions at the bottom of the file. For more information about modifying an example, please refer to the READ.ME file and chapter 1 of the Tutor manual. } {$I INTEGERS.EX } {$I CHARS.EX } {$I BINARY.EX } {$I HEX.EX } {$I IFCASE.EX } {$I FORDO.EX } {$I WHILEDO.EX } {$I REPUNTIL.EX } {$I REALS.EX } {$I SCALARS.EX } {$I SETS1.EX } {$I SETS2.EX } {$I STRINGS1.EX } {$I STRINGS2.EX } {$I ARRAYS1.EX } {$I ARRAYS2.EX } {$I RECFILES.EX } {$I READTEXT.EX } {$I WRITTEXT.EX } {$I STACK.EX } {$I RECUR.EX } {$I QUIZ.INC } { include file to give the user a quiz } procedure InitProgram(var QuizStat : QuizStatusRec); { At startup, display LogOn screen, clear the screen, draw windows, help lines, etc... }  procedure CheckForInstall; { Checks to make sure that the program has been installed } begin if InstallString = 'No Terminal Selected' then begin Writeln; Writeln('Run TUTORINS to install the TUTOR.'); Halt; end; end; { CheckForInstall } procedure ShowHelp; { Shows information from the file TUTOR.HLP in the upper window } var Err : boolean; begin SetWindow(Upper); FillChar(TextStatus, SizeOf(TextStatus), #0); with TextStatus do begin FileName := 'TUTOR.HLP'; HelpText := true; end; { with } TextWindow(TextStatus, LoadFile, Err); SetWindow(Lower); end; { ShowHelp }  procedure DisplayLogOn; { Display LOGON screen, copyright notice } var TenthsSec : byte; Ch : char; begin SetWindow(LogOn); SetColor(HiColor); with LogOnWindow do begin DrawBox(X, Y, X + Pred(Width), Y + Pred(Height)); SetWindow(LogOn); GotoWinXY(X + 2, Succ(Y)); Show('TURBO PASCAL TUTOR'); GotoWinXY(Pred(Width) - Length(Version), Succ(Y)); Show(Version); GotoWinXY(Pred(Width) - Length(OperatingSystem), Y + 2); Show(OperatingSystem); GotoWinXY(X + 2, Pred(Height)); Show('Copyright (C) 1986 BORLAND Inc.'); TenthsSec := 0; while not KeyPressed and (TenthsSec < 20) do { 2 second delay } begin Delay(100); TenthsSec := Succ(TenthsSec); end; { while } while KeyPressed do { clear keyboard buffer } Ch := GetKey; end; { with } ClrWindow; SetWindow(Full); end; { DisplayLogOn } procedure DisplayDivider; { Draw a border between the upper and lower windows } var I : byte; begin SetColor(HiColor); GotoWinXY(1, DividingLine); Show(ULcorner); for I := 2 to 79 do { draw dividing window bar } Show(AcrossCh); Show(URcorner); GotoWinXY(1, DividingLine); SetColor(HiColor); CenterStr(' Turbo Pascal Tutor '); { paint program title } end; { DisplayDivider } begin { InitProgram } CheckForInstall; { Check to make sure that TUTOR is installed }  SetWindow(Full); { clear screen } ClrScr; DisplayLogOn; { Display LOGON screen, copyright message } DisplayDivider;  FillChar(QuizStat, SizeOf(QuizStatus), #0); ShowHelp; end; { InitProgram } {$I DISPLAY.INC } { include file to handle  displays } procedure RunExample(Sel : integer); { Control routine that "runs" an example in the upper window. This is done simply by invoking the procedure by name. The source code for each procedure is inside one of the INCLUDE files above (with the same name: procedure Integers; is contained in the text file INTEGERS.EX). } begin Interrupted := False; FirstRow := WhereY; { set global variable: first line avail. to example routine } ExampleRun := True; { set flag: place quiz in lower window if requested } case Sel of { perform requested task by invoking the procedure: }  1 : Integers; 2 : Chars; 3 : Binary; 4 : Hex; 5 : IfCase; 6 : ForDo; 7 : WhileDo; 8 : RepUntil; 9 : Reals; 10 : Scalars; 11 : Sets1; 12 : Sets2; 13 : Strings1; 14 : Strings2; 15 : Arrays1; 16 : Arrays2; 17 : RecFiles; 18 : WritText; 19 : ReadText; 20 : Stack; 21 : Recur;  end; { case } end; { RunExample } procedure ManageExample(Sel : integer); { Control routine: let's the user execute an example, scroll through the source code and take a quiz. When a menu entry was selected by GetMenuOption, the upper and lower windows get cleared, the code for the example is read into the text buffer and displayed by procedure TextWindow; the user can run the example (R), take a quiz on the example's topic (^Q), scroll through the source code (using arrow keys) or return to the main menu (ESC). } var Ch : char; Err : boolean; { error flag for TSCROLL module } QuizWindow : WindowList; { which window contains the quiz } begin { ManageExample } Err := False; { set flag: no errors occurred } PrepareWindow(Upper, Examples[Sel]); SetWindow(Lower); ClrWindow; DrawHelpLine(Scrolling); FillChar(TextStatus, SizeOf(TextStatus), #0); TextStatus.FileName := Examples[Sel] + '.EX'; TextWindow(TextStatus, LoadFile, Err); while (Ch <> ESC) do  begin Ch := UpCase(GetKey); case Ch of PgUpKey : TextWindow(TextStatus, PageUp, Err); PgDnKey : TextWindow(TextStatus, PageDown, Err); UpKey, ^W : TextWindow(TextStatus, ScrollUp, Err); DownKey, ^Z : TextWindow(TextStatus, ScrollDown, Err); HomeKey : TextWindow(TextStatus, TopOfFile, Err); EndKey : TextWindow(TextStatus, EndOfFile, Err); ESC : ; 'R': begin { run the example in the upper window } DrawHelpLine(Running); if not ExampleRun then SetWindow(Upper) else PrepareWindow(Upper, Examples[Sel]); RunExample(Sel); DrawHelpLine(Scrolling); SetWindow(Lower); end; ^Q : begin { give the quiz, use upper window unless .EX was run } DrawHelpLine(Quizzing); if ExampleRun then { give quiz in lower window } QuizWindow := Lower else { give quiz in upper window } QuizWindow := Upper; PrepareWindow(QuizWindow, 'Quiz: ' + Examples[Sel]); Quiz(Sel); { quiz on current topic } DrawHelpLine(Scrolling); SetWindow(Lower);   if QuizWindow = Lower then { restore lower window } TextWindow(TextStatus, TopOfFile, Err);  end; end; { case } end; { while } TextWindow(TextStatus, CloseFile, Err); PrepareWindow(Upper, ''); { clear execution window } DrawHelpLine(Empty); SetWindow(Lower); end; { ManageExample } { =================== PROGRAM BODY ==================== } begin InitProgram(QuizStatus); { set up windows, show help } Selection := 0; { init menu control variable } repeat GetMenuOption(MaxExamples, Selection); { call main menu } if Selection <> 0 then { Want to quit? }  begin ManageExample(Selection); { show source code, run example, etc. } ClrWindow; { clear lower window } end; until Selection = 0; ExitProgram; { clean-up } end. { ------------------------------------------------------------ WINDOW.INC - Include module for TUTOR.PAS Turbo Pascal Tutor 2.0 Copyright (c) 1986 by Borland International, INC. ------------------------------------------------------------ } procedure SetColor(NewColor : ColorList); { Given a color type, set the printing color } begin if NewColor = HiColor then  NormVideo else LowVideo; PrintColor := NewColor; end; { SetColor } const DoBeep = True; DoNotBeep = False; procedure ErrorMsg(Msg : AnyString; MakeBeep : boolean); { Display an error message at the current cursor position }  begin if MakeBeep then Beep; SetColor(HiColor); Show(Msg); end; procedure Error(Msg : AnyString); { Display an error message & wait for ESC to be typed } var Ch : char; begin ErrorMsg(Msg + '. Press ', DoBeep); Ch := GetLegalKey([ESC]); end; function IOerror(Msg : AnyString) : boolean; { Called after an I/O routine. Checks IOresult, if an error occurred, displays an error message. } begin IOerror := False; { no error occurred } if IOresult <> 0 then begin ErrorMsg(Msg, DoBeep); IOerror := True; end; { if } end; { IOerror } procedure ClrWindow; { Clear the active window } begin with ScreenStatus do begin Cleared[CurrWindow] := True; with ActiveWindow do SetColor(CurrColor); end; { with } ClearScreen; end; { ClrWindow } procedure SetWindow(Win : WindowList); { Select a new active window and update the global window status record. } begin with ScreenStatus do begin case Win of Full : ActiveWindow := FullWindow; Upper : ActiveWindow := UpperWindow; Lower : ActiveWindow := LowerWindow; LogOn : ActiveWindow := LogOnWindow; end; { case } with ActiveWindow do begin GotoWinXY(1, 1); SetColor(CurrColor); end; { with } CurrWindow := Win; end; { with } end; { SetWindow } type HelpLines = (Empty, Runni ng, Scrolling, BarMenu, Quizzing); procedure DrawHelpLine(HelpLine : HelpLines); { Draw the help line on the bottom of the screen } procedure WriteHelpKey(Key, Description : AnyString); { Display a and its description. Highlight the }  begin SetColor(HiColor); Show(Key); SetColor(LoColor); Show(Description); end; { WriteHelpKey } var SaveScreen : ScreenRec; begin { DrawHelpLine } SaveScreen := ScreenStatus; SetWindow(Full); if HelpLine = Empty then SetColor(LoColor) else SetColor(HiColor); GotoWinXY(1, MaxRows); ClrEol; Show(' '); case HelpLine of BarMenu  : begin WriteHelpKey('^E', '-'); WriteHelpKey('^X', '-move bar. Select by pressing letter' + ' or '); WriteHelpKey('Return', ' '); WriteHelpKey('^Q', '-quiz '); WriteHelpKey('ESC', '-exit'); end; Scrolling : begin WriteHelpKey('R', '-run program '); WriteHelpKey('^R', '-'); WriteHelpKey('^C', '-page through text '); WriteHelpKey('^Q', '-quiz '); WriteHelpKey('ESC', '-return to main menu'); end; Running : begin Show('Running... '); WriteHelpKey('ESC', '-exit example'); end; Quizzing : begin Show('Select answer by typing correct letter.  '); WriteHelpKey('H', '-hint '); WriteHelpKey('ESC', '-exit quiz'); end; end; { case } ScreenStatus := SaveScreen; SetWindow(Restore); end; { DrawHelpLine } procedure DrawTitle(Title : AnyString); { Draw the title on line 1 of the full window } var SaveScreen : ScreenRec; begin SaveScreen := ScreenStatus; SetWindow(Full); GotoWinXY(1, 1); ClrEol; if Title <> '' then begin SetColor(HiColor); CenterStr(' ' + UpperCase(Title) + ' '); end; { if } SetWindow(Restore); ScreenStatus := SaveScreen; end; { DrawTitle } procedure PrepareWindow(WhichWindow : WindowList; Title : AnyString); { Called just before a "windowed" procedure is executed. Sets up  execution window, paints title, etc... } begin DrawTitle(Title); SetWindow(WhichWindow); ClrWindow; end; { PrepareWindow } { ------------------------------------------------------------ WINDOW.INC - End of Include module for TUTOR.PAS ------------------------------------------------------------ } { ------------------------------------------------------------ QUIZ.INC - Include module for TUTOR.PAS Turbo Pascal Tutor 2.0 Copyright (c) 1986 by Borland International, INC. ------------------------------------------------------------ This  include module contains the declarations and routines that manage the multiple choice quiz for TUTOR.PAS. The quiz can be given in either window (upper or lower); the questions are read from a binary file, QUIZ.DTA. The first record in QUIZ.DTA (rec# 0) is a dummy record that is an index into the data file (see QuizIndex declaration below). The index is an array of integers--one for each quiz topic. Each element contains the record number of the first quiz question associated with a given topic: QuizIndex rec# of first question --------- ---------------------- 1 1 2 7 ...  ... MaxExamples 96 } procedure Quiz(CurrQuizTopic : integer); { This routine puts up a multiple choice quiz in the current window using the data file QUIZ.DTA. } procedure CleanUpQuiz; { Clean up quiz window before exit } begin DrawTitle(''); ClrWindow; end; { CleanUpQuiz } function OpenQuizFile(var QuizStatus : QuizStatusRec) : boolean; { Open the data file and read the index stored at the beginning of the file. Return true if the operation was successful, otherwise return false. } var Rec : QuizRec; Ch : char; begin { OpenQuizFile } with QuizStatus do begin FillChar(QuizIndex, SizeOf(QuizIndex), 0); { init index to zeros } Assign(QuizFile, QuizFileName); { open the file } {$I-} Reset(QuizStatus.QuizFile); {$I+} FileOpened := IOresult = 0; if FileOpened then begin if not EOF(QuizFile) then { get index from rec# 0 } begin Read(QuizFile, Rec); Move(Rec, QuizIndex, SizeOf(QuizIndex));  end; end else begin Showln(''); Error('Cannot find ' + QuizfileName); end; { else } OpenQuizFile := FileOpened; end; { with } end; { OpenQuizFile } function GetNextQuestion(var F : QuizFileType;  var QuizItem : QuizRec; CurrTopicNumber : integer) : boolean; { Given a topic number, this function reads the quiz file and returns true if the question read belongs to the current topic. } begin FillChar(QuizItem, SizeOf(QuizItem), #0); { init record } if not EOF(F) then begin Read(F, QuizItem); GetNextQuestion := QuizItem.TopicNumber = CurrTopicNumber; { this topic? } end else GetNextQuestion := false; { no more questions } end; { GetNextQuestion } function AskQuestion(QuestionNum : integer; QuizItem : QuizRec; var Response : char) : boolean; { This routine displays and asks the user a quiz question. } var X, Y : byte; MaxAnswer, Ch : char; procedure ShowQuestion(QuizItem : QuizRec); { Display the quiz question } begin with QuizItem do begin SetColor(LoColor); Showln(''); Showln(' ' + IntToString(QuestionNum, 1) + '. ' + Question); Showln(''); MaxAnswer := Pred('A'); for Ch := 'A' to LastAnswer do if Choices[Ch] <> '' then begin Showln(' ' + Ch + ': ' + Choices[Ch]); MaxAnswer := Ch; end else Showln(''); Showln(''); Show(' Solution: '); SetColor(HiColor); Show(' ' + BS); end; { with } end; { ShowQuestion } procedure ShowHint(HintLine : HintStr ); { Show the hint } begin X := WhereX; Y := WhereY; GotoWinXY(2, Succ(WhereY)); SetColor(HiColor); Show('HINT: ' + HintLine); SetColor(LoColor); GotoWinXY(X, Y); end; { ShowHint } begin { AskQuestion } AskQuestion := false; { assume incorrect answer } ShowQuestion(QuizItem); with QuizItem do begin repeat Response := GetLegalKey(['H', 'A'..MaxAnswer, ESC]); if Response = 'H' then ShowHint(Hint); until Response in ['A'..MaxAnswer, ESC];  SetColor(HiColor); if Response = ESC then CleanUpQuiz else begin Show(Response + ' ');  if Solution = Response then begin SetColor(LoColor); Show('Right!'); AskQuestion := true;  end end { else } end; { with } end; { AskQuestion } var Ch : char; QuizR : QuizRec; QuesCount : integer; MoreToAsk : boolean; procedure CheckNoQuestions(QuesCount : integer); begin if QuesCount = 0 then begin Showln(''); Error(' Sorry, no questions for this topic'); CleanUpQuiz; end; end; { CheckNoQuestions } function ReadyForAnother(var Ch : char) : boolean; begin Show(' Ready for another? '); Ch := GetLegalKey(['Y', 'N', ESC]); if Ch <> 'Y' then begin SetColor(LoColor); Show('No'); CleanUpQuiz; end; ReadyForAnother := Ch = 'Y'; end; { ReadyForAnother } procedure InitQuiz; begin SetColor(LoColor); QuesCount := 0; Ch := ESC; { assume error } with QuizStatus do begin if not FileOpened then { first time through? } if not OpenQuizFile(QuizStatus) then { can't find the file } begin CleanUpQuiz; Exit; end; { if } { Use index to get first question this topic } if (QuizIndex[CurrQuizTopic] > 0) and (QuizIndex[CurrQuizTopic] < FileSize(QuizFile)) then Seek(QuizFile, QuizIndex[CurrQuizTopic]) else begin Showln(''); Error('DATA ERROR: Re-copy QUIZ.DTA from your master disk'); CleanUpQuiz; Exit; end; { else } end; { with } Ch := ' '; { no error occurred } end; { InitQuiz } begin { -- Quiz -- } InitQuiz; if Ch = ESC then Exit; { error during init } with QuizStatus do begin MoretoAsk := GetNextQuestion(QuizFile, QuizR, CurrQuizTopic); while MoreToAsk and (Ch <> ESC) do begin QuesCount := Succ(QuesCount); if not AskQuestion(QuesCount, QuizR, Ch) then begin if Ch = ESC then Exit { user typed escape } else { wrong answer } ErrorMsg('The correct answer is ' + QuizR.Solution + '.', DoBeep); end; { if } SetColor(HiColor); MoretoAsk := GetNextQuestion(QuizFile, QuizR, CurrQuizTopic); if MoreToAsk then { more questions? } begin if not ReadyForAnother(Ch) then Exit; { user ready to quit } ClrWindow;  end { if } else begin ErrorMsg(' No more questions. Press ', DoNotBeep); Ch := GetLegalKey([ESC]); CleanUpQuiz; end; end; { while } CheckNoQuestions(QuesCount); end; { with } end; { Quiz } { ------------------------------------------------------------ QUIZ.INC - End of include module for TUTOR.PAS ---- -------------------------------------------------------- } { ------------------------------------------------------------ DISPLAY.INC - Include module for TUTOR.PAS Turbo Pascal Tutor 2.0 Copyright (c) 1986 by Borland International, INC. ------------------------------------------------------------ }  procedure DrawBox; { Draw a box on the screen } var I : integer; begin GotoWinXY(X1, Y1); Show(ULcorner); GotoWinXY(X2, Y1); Show(URcorner); for I := Succ(X1) to Pred(X2) do begin GotoWinXY(I, Y1); Show(AcrossCh); GotoWinXY(I, Y2); Show(AcrossCh); end; { for } GotoWinXY(X1, Y2); Show(LLcorner); GotoWinXY(X2, Y2); Show(LRcorner); for I := Succ(Y1) to Pred(Y2) do begin GotoWinXY(X1, I); Show(DownCh); GotoWinXY(X2, I); Show(DownCh); end; { for } end; { DrawBox } procedure GetMenuOption(MaxItems : integer; var Sel : integer); { Paint a menu, select a legal value. Returns selection in sel parameter. ItemList is an array of strings. CurrMenu indicates which menu is being displayed. MaxItems indicates the number of items to display. } const StartRow = 5; NumCols = 4; var StartCol, ItemWidth, NumRows : integer; procedure CalcMenuSize; { Compute the menu's dimensions: Number of rows (NumRows) Width per item (ItemWidth)  Leftmost column (StartCol) } begin NumRows := (MaxItems + Pred (NumCols)) div NumCols; ItemWidth := Pred(SizeOf(ExampleStr)); ItemWidth := (75 - ItemWidth * NumCols) div NumCols + ItemWidth; StartCol := 80 - ItemWidth * NumCols; end; { CalcMenuSize } procedure DisplayItem(Color : ColorList; Sel : integer; Item : AnyString); { Given a string and its selection number, go to correct coordinates and display it. } var LeftChar, RightChar, Ch : char; begin if Color = LoColor then begin LeftChar := ' '; RightChar := ' '; end else begin LeftChar := '<'; RightChar := '>'; end; SetColor(Color); GotoWinXY(Pred(StartCol) + (Pred(Sel) div NumRows) * ItemWidth, StartRow + Pred(Sel) mod NumRows); Item[1] := UpCase(Item[1]); Ch := Chr(Ord('A') + Pred(Sel)); Show(LeftChar + Ch + ': ' + Item + RightChar); end; { DisplayItem } procedure GetSelection(var Sel : integer; HighestSel : integer); { Get selection number from user; allow entry via letters (A,B..) or let the user move the highlighted bar and type to select an entry. } var Ch : char; LastSel : integer; procedure MoveBar(var Ch : char;  var Sel : integer; LastSel : integer); { Given a character, increment the current selection number, move the highlighted bar or allow the user to select an entry. } begin case Ch of ^Q : begin { Quiz }  DrawHelpLine(Quizzing); PrepareWindow(Upper, 'Quiz: ' + Examples[Sel]); Quiz(Sel); { quiz on curren t topic } DrawHelpLine(BarMenu); SetWindow(Lower); end; 'A'..'Z' : begin { allow selection by letter } Sel := 1 + Ord(Ch) - Ord('A'); if Sel > HighestSel then { invalid letter }  begin Sel := LastSel; Ch := NULL; end; end; ESC : Sel := 0; { exit program } CR : ; { they selected an entry } ^A : Sel := 1; { to first entry } ^E : if Sel > 1 then Sel := Pred(Sel) else Sel := HighestSel; ^S : begin if Sel - NumRows > 0 then Sel := Sel - NumRows  else begin if Sel = 1 then Sel := Succ(NumRows); Sel := Pred(Sel + (NumRows * Pred (NumCols))); if Sel > MaxItems then  Sel := Sel - NumRows; end; { else } end; ^D : if Sel + NumRows <= HighestSel then Sel := Sel + NumRows else Sel := Succ(Sel mod NumRows); ^F : Sel := HighestSel; { to last entry } ^X : if Sel < HighestSel then  Sel := Succ(Sel) else Sel := 1; ^C : while (Sel < HighestSel) and { to bottom of column } (Sel mod NumRows <> 0) do Sel := Succ(Sel); ^R : while (Sel > 1) and { to top of column } (Sel mod NumRows <> 1) do Sel := Pred(Sel); else Beep { error: illegal character input } end; { case } end; { MoveBar } procedure BarOff(LastSel, Sel : integer); { Turn the highlighted bar off (if it was on) } begin if (LastSel <> Sel) and (LastSel <> 0) then begin if LastSel > 0 then DisplayItem(LoColor, LastSel, Examples[LastSel]); end; { if } end; { BarOff } begin { GetSelection }  LastSel := 0; ExampleRun := False; if (Sel < 1) or (Sel > MaxItems) then Sel := 1; { out of range } repeat { Get a menu selection: } BarOff(LastSel, Sel); { turn off previous bar } DisplayItem(HiColor, Sel, Examples[Sel]); { display current bar } LastSel := Sel; { remember prev. bar } Ch := UpCase(GetKey); { get a keystroke } MoveBar(Ch, Sel, LastSel); { move the bar or select } until (Sel in [0..HighestSel]) and (Ch in [ESC, CR, 'A'..'Z']); end; { GetSelection } var I : integer; begin { GetMenuOption } CalcMenuSize; { determine menu dimensions } DrawHelpLine(BarMenu); { draw function bar } with ScreenStatus do begin SetColor(LoColor); GotoWinXY(1, 3); CenterStr(' List of Topics '); { title } for I := 1 to MaxItems do { show each topic } DisplayItem(LoColor, I, Examples[I]); Cleared[CurrWindow] := False; { set flag: menu is displayed } end; { with } GetSelection(Sel, MaxItems); end; { GetMenuOption } procedure ExitProgram; { Exit the program, clear the screen } begin SetWindow(Full); GotoWinXY(1, MaxRows); Chan geVideo(VLow); ClrScr; Halt; end; { CloseSystem } { ------------------------------------------------------------ DISPLAY.INC - End of Include module for TUTOR.PAS ------------------------------------------------------------ } { ------------------------------------------------------------ TSCROLL.INC - Include module for TUTOR.PAS Turbo Pascal Tutor 2.0 Copyright (c) 1986 by Borland International, INC. ------------------------------------------------------------  This include module contains the declarations and routines that manage scrolling through the source code for TUTOR.PAS. The source is displayed in the lower window of the TUTOR and the user can page or scroll through the text. It also reads and displays the TUTOR.HLP file when the program is first loaded. } const MaxTextLines = 300; { size of array: max file size in lines } type TextCommands = (LoadFile, CloseFile, TopOfFile, EndOfFile, PageDown, PageUp, ScrollUp, ScrollDown); RowType = string[79]; { LowerWindow: Pred(Width) } TextArray = array[1..MaxTextLines] of RowType; TextRec = record FileName : NameStr; TextF : text; TextLines : TextArray; Margin, LastLineRead, TopLine, BottomLine, TotalRows : integer; Found, HelpText : boolean; end; var TextStatus : TextRec; procedure TextWindow(var TextStatus : TextRec; Command : TextCommands;  var Err : boolean); { Main routine that manages scrolling through the text: TextStatus - the text file info (which file name, line, etc.) Command - the command to execute in the lower window Err - flag returned by this procedure: true = error occurred } procedure OpenFile(var TextStatus : TextRec); { Opens the text file to be displayed } procedure LoadArray(var TextStatus : TextRec); { Does the actual read of the text file into the array of strings } var Ch : char; I, LongestLine : integer; Stop : boolean; S : RowType; procedure CheckForSpecialComment(var s : RowType); { We placed special comments in the .EX files. This routine checks a line to see whether it contains our special comment marker, (**. If it finds one, if then looks for its corresponding end marker, **). } var FoundEndMarker : boolean; begin { Find a special comment? Skip lines until we find its end marker } if Pos('(**', s) = 1 then begin FoundEndMarker := false; repeat Readln(TextStatus.TextF, s); FoundEndMarker := (Pos('**)', s) > 0) or FoundEndMarker; until EOF(TextStatus.TextF) or ((Pos('**)', s) = 0) and FoundEndMarker and (s <> '')); if Pos('**)', s) > 0 then s := ''; end; { if } end; { CheckForSpecialComment } begin { LoadArray } LongestLine := 0; with TextStatus do begin Showln(' Loading text:'); LastLineRead := 0; Stop := EOF(TextF); while not Stop and { end of file } (LastLineRead < Pred(MaxTextLines)) do { buffer full } begin LastLineRead := Succ(LastLineRead); { increment line counter }   Readln(TextF, TextLines[LastLineRead]); CheckForSpecialComment(TextLines[LastLineRead]); if Length(TextLines[LastLineRead]) > LongestLine then LongestLine := Length(TextLines[LastLineRead]); if LastLineRead mod 16 = 0 then Show(CR + IntToString(LastLineRead, 6)); Stop := EOF(TextF); end; { while } Show(CR + IntToString(LastLineRead, 6)); Showln(''); Showln(''); if not EOF(TextF) then Error('Text buffer full'); case LongestLine of 1..78 : Margin := 78 - LongestLine; { 78 = rowtype - 2 } else Margin := 0; end; { case }  if Margin > 4 then Margin := 4; { Trim trailing blank lines } while (LastLineRead > 1) and (TextLines[LastLineRead] = '') do LastLineRead := Pred(LastLineRead); if not HelpText then begin { Add extra last line to indicate end of file on screen } LastLineRead := Succ(LastLineRead); FillChar(TextLines[LastLineRead][1], Pred(SizeOf(RowType)), #32); TextLines[LastLineRead][0] := Chr(LongestLine); S := '[ end of source ]'; I := (LongestLine - Length(S)) DIV 2; Move(S[1], TextLines[LastLineRead][I], Length(S)); { center it } end; end; { with } end; { LoadArray } procedure Init(var TextS : TextRec); { Initializes the text status record when a new file is read in } begin { Init } with TextS do begin TotalRows := ScreenStatus.ActiveWindow.Height; TopLine := 1; with TextStatus do  if TotalRows > LastLineRead then BottomLine := LastLineRead else BottomLine := TotalRows; end; { with } Showln(''); end; { Init } var Ch : char; begin { OpenFile } Init(TextStatus); { init vars } with TextStatus do begin  Assign(TextF, FileName); { open the new file } {$I-} Reset(TextF); {$I+} Err := IOresult <> 0; if Err then begin Found := False; { File was not found } Exit; end; Found := True; { File was found } LoadArray(TextStatus); end; { with } end; { OpenFile } procedure DisplayPage(var TextStatus : TextRec); { Display a page of text } var Counter, Row : integer; begin with TextStatus do begin if not Found then { Will only display a file that was read in } Exit; GotoWinXY(1, 1); for Row := TopLine to Pred(TopLine + TotalRows) do begin for Counter := 1 to Margin do Show(' '); if Row <= BottomLine then Show(TextLines[Row]); ClrEol; if Row < Pred(TopLine + TotalRows) then Showln(''); end; end; { with } end; { DisplayPage } procedure BeginFile(var TextStatus : TextRec); { Display the first page of the file } begin with TextStatus do begin if not Found then { special case: instead of text, give msg } begin if not HelpText then { not showing message if trying to display help } begin GotoWinXY(1, 3); ErrorMsg('Cannot find ' + FileName, DoNotBeep) end;  end else begin TopLine := 1; if (Pred(TopLine + TotalRows)) > LastLineRead then { set BottomLine }  BottomLine := LastLineRead else BottomLine := Pred(TopLine + TotalRows); DisplayPage(TextStatus);   end; end; { with } end; { BeginFile } procedure EndFile(var TextStatus : TextRec); { Display the last page of the file } begin with TextStatus do begin BottomLine := TextStatus.LastLineRead; if (Succ(BottomLine - TotalRows)) > 1 then TopLine := (Succ(BottomLine - TotalRows)) else TopLine := 1; DisplayPage(TextStatus); end; { with } end; { EndFile } procedure DownPage(var TextStatus : TextRec); { Display the next page down } begin with TextStatus do if BottomLine < LastLineRead then begin if (Pred(BottomLine + TotalRows)) > LastLineRead then BottomLine := LastLineRead else BottomLine := Pred(BottomLine + TotalRows); if (Succ(BottomLine - TotalRows)) > 1 then TopLine := (Succ(BottomLine - TotalRows)) else TopLine := 1; DisplayPage(TextStatus); end; end; { Downpage } procedure UpPage(var TextStatus : TextRec); { Display the previous page } begin with TextStatus do if TopLine > 1 then begin if (Succ(TopLine - TotalRows)) > 1 then { set TopLine } TopLine := Succ(TopLine - TotalRows) else TopLine := 1; if (Pred(TopLine + TotalRows)) > LastLineRead then { set BottomLine } BottomLine := LastLineRead else BottomLine := Pred(TopLine + TotalRows); DisplayPage(TextStatus); end; end; { UpPage } procedure UpLine(var TextStatus : TextRec); { Scroll up one line } begin with TextStatus do begin if TopLine > 1 then begin TopLine := Pred(TopLine); BottomLine := Pred(BottomLine); DisplayPage(TextStatus); end; { if } end; { with } end; { UpLine } procedure DownLine(var TextStatus : TextRec); { Scroll down one line } begin with TextStatus do begin if BottomLine < TextStatus.LastLineRead then begin TopLine := Succ(TopLine); BottomLine := Succ(BottomLine); DisplayPage(TextStatus); end; { if } end; { with } end; { DownLine } begin { TextWindow } case Command of LoadFile : begin OpenFile(TextStatus); { read from disk } BeginFile(TextStatus); { top of file } end; TopOfFile  : BeginFile(TextStatus); { top of file } PageDown : DownPage(TextStatus); { down 1 page } PageUp : UpPage(TextStatus); { up 1 page } ScrollUp : UpLine(TextStatus); { up 1 line } ScrollDown : DownLine(TextStatus); { down 1 line } EndOfFile : EndFile(TextStatus); { end of file } CloseFile : Close(TextStatus.TextF); { close disk file } end; { case } end; { TextWindow } { ------------------------------------------------------------ TSCROLL.INC - End of Include module for TUTOR.PAS ------------------------------------------------------------ }  { ------------------------------------------------------------ TUTOR.LIB - Include module for TUTOR.PAS Turbo Pascal Tutor 2.0 Copyright (c) 1986 by Borland International, INC. ------------------------------------------------------------ This include module contains declarations and routines that are used by many of the example routines (contained in .EX files). } type DummyType = char; { Used at the top of each .EX file to generate a compiler error so we can explain how to compile the .EX files separately. Look in one of the .EX files for more information. } AnyString = string[80]; { Generic string type } VideoType = (VLow, VNorm); CharSet = set of char; ColorList = (HiColor, LoColor); WindowList = (Full, Upper, Lower, LogOn, Restore); ClearedStatus = array[WindowList] of boolean; WindowRec = record X, Y, Height, Width : byte; CurrColor : ColorList; end; ScreenRec = record { record used to manage screen } CurrWindow : WindowList; ActiveWindow : WindowRec; Cleared : ClearedStatus; end; const ON = True; OFF = False; MaxRows = 25; { Maximum rows per screen } FullWindow : WindowRec = (X : 1; Y : 1; { full screen } Height : MaxRows;  Width : 80; CurrColor : LoColor); { Define some important keystrokes: } NULL  = #0; Bell = #7; BS = #8; LF = #10; CR = #13; ESC  = #27; HomeKey = ^A; EndKey = ^F; { cursor control keys } UpKey = ^E; DownKey = ^X; PgUpKey = ^R; PgDnKey = ^C; LeftKey = ^S; InsKey = ^V; RightKey = ^D;  DelKey = ^G; IntChar = #27; var Interrupted : boolean; FirstRow : integer; PrintColor : ColorList; { The current printing color } WhereX, WhereY : byte; { The current cursor location } ScreenStatus : ScreenRec; procedure GotoWinXY(Col, Row : byte); { Moves to a selected location within the current window } begin with ScreenStatus.ActiveWindow do begin GotoXY(Pred(X + Col), Pred(Y + Row)); WhereX := Col; WhereY := Row; end; { with } end; { GotoWinXY } procedure Show(S : AnyString); { Prints text in PrintColor at the current cursor position } var Counter : byte; begin for Counter := 1 to Length(S) do begin case S[Counter] of { Modify WhereX and WhereY for special chars } BS : WhereX := Pred(WhereX); CR : WhereX := 1; LF : WhereY := Succ(WhereY) else begin WhereY := WhereY + (WhereX div 80); WhereX := Succ(WhereX mod 80); end; end; { case } Write(S[Counter]); { Print the character } end; end; { Show } procedure Showln(S : AnyString); { Prints text + a carriage return/line feed at the current cursor position } begin Show(S + CR + LF); end; { Showln } procedure ClearScreen; { Clears the screen within the act ive window } var S : string[80]; Counter : byte; begin with ScreenStatus.ActiveWindow do begin FillChar(S[1], Width, ' '); { Prepare a blank string to fill each line } S[0] := Chr(Width); { Set the length byte of the string } for Counter := Y to Pred(Y + Height) do begin GotoXY(X, Counter); if Counter = MaxRows then Delete(S, Length(S), 1); Show(S); end; GotoWinXY(1, 1); { Move the cursor to the upper left corner of the window } end; end; { ClearScreen } procedure ChangeVideo(NewMode : VideoType); { Changes the text and background colors } begin case NewMode of VLow : LowVideo; VNorm : NormVideo; end; { case } end; { ChangeVideo } function UpperCase(S : AnyString) : AnyString; { Convert a string to all upper case letters } var I : integer; begin for I := 1 to Length(S) do  S[I] := UpCase(S[I]); UpperCase := S; end; { UpperCase } procedure CenterStr(S : AnyString); { Center a string } begin GotoWinXY(41 - (Length(S) div 2), WhereY); Show(S); end; { CenterStr } procedure Beep; { Sound the "bell" } begin  Write(^G); end; { Beep } function GetKey : char; { Read a character. If IntChar is pressed, set the global variable Interrupted in order to stop the program. } var Ch : char; begin Read(Kbd, Ch); if (Ch = ESC) and KeyPressed then { Check for an escape sequence } begin while KeyPressed do Read(Kbd, Ch); { Remove characters from buffer } Ch := NULL; { Transmit a null instead of ESC } end; Interrupted := Ch = IntChar; { sample program will be interrupted } GetKey := Ch; end; { GetKey } function GetLegalKey(LegalChar : CharSet) : char; { Keep reading a character until it is in the set of legal chars } var Ch : char; begin repeat Ch := UpCase(GetKey); until Ch in (LegalChar + [IntChar]); GetLegalKey := Ch; end; { GetLegalKey } function IntToString(Num, Width : integer) : AnyString; { Changes an integer into a string } var TempString : AnyString; begin Str(Num:Width, TempString); IntToString := TempString; end; { IntToString } function RealToString(Num : real; Width, Places : integer) : AnyString; { Changes a real number into a string } var TempString : AnyString; begin Str(Num:Width:Places, TempString); RealToString := TempString; end; { RealToString } function BoolToString(BoolExp : boolean) : AnyString; { Changes a boolean expression into a string } begin if BoolExp = True then BoolToString := 'TRUE ' else BoolToString := 'FALSE'; end; { BoolToString } function Pad(Pstring : AnyString; Len : byte) : AnyString; { Pads a string to a specified length } var StringLen : byte absolute Pstring; { Make a variable for Pstring's length byte } begin while StringLen < Len do { Pad Pstring with spaces on the right } Pstring := Pstring + ' ';  Pad := Pstring; end; { Pad } function RJust(Jstring : AnyString; Len : byte) : AnyString; { Right-justifies a string to a specified length } var StringLen : byte absolute Jstring; { Make a variable for Jstring's length byte } begin while StringLen < Len do Jstring := ' ' + Jstring; RJust := Jstring; end; { RJust } procedure Print(Pstring : AnyString; Vtype  : VideoType); { Prints a string in a particular video mode } begin ChangeVideo(Vtype); Show(Pstring); end; { Print }  procedure PrintXY(Pstring : AnyString; Vtype : VideoType; Col, Row : byte); { Prints a string at a screen position in a particular video mode } begin GotoWinXY(Col, Row); Print(Pstring, Vtype); end; { PrintXY } procedure PrintCommandXY(Pstring : AnyString; Col, Row : byte); { Prints a command string, highlighting any capital letters in the string } var Counter : byte; begin GotoWinXY(Col, Row); for Counter := 1 to Length(Pstring) do begin if PString[Counter] in ['A'..'Z'] then Print(PString[Counter], VNorm) else Print(PString[Counter], VLow); end; end; { PrintCommandXY } procedure ClearXY(Col, Row : byte); { Clears to the end of a line from a selected column and row } begin GotoWinXY(Col, Row);  ChangeVideo(VLow); ClrEol; end; { ClearXY } function GetString(Col, Row, Len : byte) : AnyString; { Reads in a string from the keyboard } var Strng : AnyString; Inp : char; CurrLen : byte absolute Strng; begin Strng := ''; PrintXY(Pad('', Len), VNorm, Col, Row); { Blank out input field } GotoWinXY(Col, Row); repeat Inp := GetKey; case Inp of ' '..'~': if CurrLen < Len then { Add new character to string } begin Strng := Strng + Inp;  Show(Inp); end; BS: if CurrLen > 0 then { Backspace one character } begin Show(BS + ' ' + BS); Delete(Strng, CurrLen, 1); end; IntChar: Interrupted := True; { Interrupt the program } end; { case } until ((Strng <> '') and (Inp = CR)) or (Interrupted); PrintXY(Pad(Strng, Len), VLow, Col, Row); { Print out the string in low video } GetString := Strng; end; { GetString } function GetChar(Col, Row : byte) : char; { Reads in a character at an x,y location } var TempString : AnyString; begin TempString := GetString(Col, Row, 1); GetChar := TempString[1]; end; function GetInteger(Col, Row, Len : byte; Low, High : integer) : integer; { Reads an integer within a specified range from the keyboard } var IntString : AnyString; Number, Result : integer; GoodNumber : boolean; begin repeat IntString := GetString(Col, Row, Len); Val(IntString, Number, Result); { Change string to integer } GoodNumber := ((Number >= Low) and (Number <= High) and (Result = 0) and (IntString <> '') and (IntString <> '-')) or (Interrupted); { Check for a legal number } if not GoodNumber then Beep; { Beep speaker if the number is bad } until GoodNumber; PrintXY(RJust(IntString, Len), VLow, Col, Row); { Print number right-justified } GetInteger := Number; end; { GetInteger } function GetReal(Col, Row, Len : byte; Low, High : real) : real; { Reads a real number within a specified range from the keyboard } var RealString : AnyString; Number : real; Result : integer; GoodNumber : boolean; begin repeat RealString := GetString(Col, Row, Len); Val(RealString, Number, Result); { Change string to real } GoodNumber := ((Number >= Low) and (Number <= High) and (Result = 0) and (RealString <> ''  ) and (RealString <> '.') and (RealString <> '-') and (RealString <> '-.')) or (Interrupted); { Check for a legal number } if not GoodNumber then Beep; { Beep speaker if the number is bad } until GoodNumber; PrintXY(RJust(RealString, Len), VLow, Col, Row); { Print number right-justified } GetReal := Number; end; { GetReal } function CheckInterrupt : boolean; { Checks to see if the user wants to stop the "current" routine } var Ch : char; begin CheckInterrupt := False; if not KeyPressed then Exit; Ch := GetKey; if Ch = IntChar then { user interruped: wants to exit } begin Interrupted := True; CheckInterrupt := True; end; end; { CheckInterrupt } procedure ClearLines(FirstLine, LastLine : byte); { Clears the lines from FirstLine to LastLine on the screen } var Counter : byte; begin ChangeVideo(VLow); GotoWinXY(1, FirstLine); for Counter := 1 to Succ(LastLine - FirstLine) do begin ClrEol;  Showln(''); end; end; { ClearLines } procedure Message(S : AnyString); { Display a message on the tenth line of the current window } begin ClearXY(1, FirstRow + 9); Print(S, VNorm); end; { Message } procedure InitExample; { Initializes variables for the example programs when they are run without the rest of the TUTOR. } begin Interrupted := false;  with ScreenStatus do begin CurrWindow := Full; ActiveWindow := FullWindow; Cleared[Full] := false; end; { with } ClearScreen; FirstRow := 1; end; { InitExample } { ------------------------------------------------------------ TUTOR.LIB - End of include module for TUTOR.PAS ------------------------------------------------------------ }  WELCOME TO TURBO TUTOR 2.0 -------------------------- This file contains important information not found in the Owner's Handbook. Included is information on how to get technical help, how to install the TUTOR program, corrections to the Owner's Handbook, answers to common questions, and a complete list of files on the distribution disks. Since this file contains information important to you, please read it in its entirety; hopefully it will answer any questions you may have. TABLE OF CONTENTS ----------------- 1. How to Get Help 2. Installing the TUTOR Program by Running TUTORINS 3. Changes to the Owner's Handbook. 4. Answers to Common Questions. 5. File List 1. HOW TO GET HELP ------------------ If you need help with the Turbo Pascal Tutor, please read this help file and the reference manual thoroughly. If you still have a question and need technical assistance, please have the following information ready before calling our technical support department: 1. Product name and version number. (The version number of Turbo Pascal appears above the "Include error messages?" prompt when the program is first loaded.) 2. Computer name, model and any additional hardware. 3. Operating system and version number. (The version number generally is displayed when your system is first booted.) Technical assistance is also available from the following sources: 1. Type GO BORLAND on the Comp! uServe bulletin board system. 2. Check with your local software dealer or user group. 3. Write to: Borland International Turbo Pascal Technical Support 4585 Scotts Valley Drive Scotts Valley, CA 95066 2. INSTALLING THE TUTOR USING TUTORINS -------------------------------------- Before loading the TUTOR program (TUTOR.COM), you must run the installation program, TUTORINS: 1. Make backup copies of all the disks. 2. Copy TUTOR.COM located on the "Program Disk" onto the "Source Disk". 3. With the "Source Disk" in the drive, at the DOS prompt, type TUTORINS and hit . 4. Pick "S" for screen installation and choose the terminal type on your system.  5. Type "N" when asked whether you wish to modify the terminal installation. 6. Specify the speed of your computer in megahertz (if you are not sure, press ). 7. Type "Q" to quit the installation program. 8. Copy this installed TUTOR.COM from the "Source Disk" back onto the "Program Disk". You have now installed the TUTOR program for your system. If you need help on how to use TUTORINS, refer to Appendix L of your Turbo Pascal Reference Manual. NOTE: TUTORINS was created using the GINST program from the Turbo Database Toolbox. GINST generates a screen installation program for any Turbo Pascal program. 3. CHANGES TO THE OWNER'S HANDBOOK ---------------------------------- IMPORTANT: Note that any changes to source code contained in the manual have already been made in the file MANUAL.PAS (on the SAMPLE PROGRAMS disk). Page xiv: Introduction ----------------------- Middle of page The body of this manual is set in a normal typeface, an alternate typeface is used in program examples, and italics are used to mark reserved words in the main text as well as in programming examples. should be: The body of this manual is set in a normal typeface, an alternate typeface is used in program examples, and italics are used to emphasize concepts and to draw attention to terms when they are first used. Boldface type is used to mark reserved words. Page 12: Central Processing Unit -------------------------------- Some popular CPUs are the 8088 and the Z80 (which are usually used in computers running the CP/M operating system) and the 8088 (used in the IBM PC to run PC-DOS or MS-DOS). should be: Some popular CPUs are the Z80 (which is usually used in computers running the CP/M operating system) and the 8088 (used in the IBM PC to run PC-DOS or MS-DOS). Page 35: Using TINST on the IBM PC and Compatible Systems --------------------------------------------------------- First example  Your computer has a graphics display board that is subject to "snow." By using TINST, you may be able to improve your screen's performance. should be: Your computer has a color graphics display board that is not subject to "snow." Run TINST, install the screen and select the default installation. Answer "N" to the question, "Does your screen blink when the text scrolls?" This will optimize the video output when you are using the Turbo editor. Page 58: Figure 7-3 --------" ----------- Note: The diagram is for a digit, not the word "digit." Page 82: Comments: The Rest of The Story ---------------------------------------- Bottom of page { Old_a := a; {Save the old value of a} Readln (a); {Read a new value for a} should be: { Old_a := a; {Save the old value of a} Readln (a); {Read a new value for a} } Page 94: Char ------------- Third paragraph Nonprinting characters are another matter, as are the characters prior to value 126 (those characters for which there is no key on your keyboard). should be: Nonprinting characters are another matter, as are the characters subsequent to value 126 (those characters for which there is no key on your keyboard). Page 105: Standard Functions for Scalar Type -------------------------------------------- Top of page If DayOfWeek has the value Sunday, NextDay is assigned the value Monday; if it's Monday, NextDay will become Tuesday, and so on. should be:  If DayOfWeek has the value Tuesday, NextDay is assigned the value Wednesday; if it's Thursday, NextDay will become Friday, and so on. Explanation: The author mistakenly assumed that the FIRST day of the week was Sunday and, naturally, the successor of the first day of the week equals the second day. Unfortunately, Sunday is the LAST day of the week and the successor of the last day of the week is UNDEFINED. Of course, as programmers, we simply wraparound by using the following  Logic: if DAY = then DAY := else DAY := Succ(  ); Page 129 : Subprograms, Page 136: Parameters -------------------------------------------- In procedure GetNumber  'Minimum, ' to ', Maximum, ': '); should be: Minimum, ' to ', Maximum, ': '); Page 130: Subprograms --------------------- Top of page for Index := 1 to 10 do should be: for Index := 1 to Ten do Page 138-139: Functions  ----------------------- Note: All references to the variable "Val" should be changed to "Value." "Val" is a predefined identifier, and should not be used for a variable name. Page 143: Forward Declarations ------------------------------ In procedure Test2 { We've commented out the parameter list; } should be: { We've commented out the parameter list; Page 144: Scope and Recursion ----------------------------- Function A if G > 1 then X := A(G 1) should be:  if G > 1 then X := A(G-1) Page 145: The Exit Procedure ---------------------------- Note: All references in the code to 1 or 1.0 should be changed to -1 or -1.0 (respectively). Page 164: Miscellaneous Character Functions ------------------------------------------- In program PrintASCII var 1 :integer; should be: var i :integer; Page 188: Set Equality and Inequality ------------------------------------- In program EqualityTest program EqualityTest should be: program EqualityTest; Page 209: Write Parameters and Output -------------------------------------- In program FormatDemo WriteLn( Pi:8); should be: WriteLn(-Pi:8); Page 213: The Assign Procedure ------------------------# ------ Bottom of page If a file name has no drive number preceding it, should be: If a file name has no drive letter preceding it, Page 217: Creating a Random Access File --------------------------------------- In procedure MakeCheckFile Writeln('Enter information for check #', Num:0, ': '); should be: Writeln('Enter information for check #', CheckNumber, ': '); Delete the next two lines after this line. Page 218: Creating a Random Access File --------------------------------------- In procedure MakeCheckFile { Got all the information, write it out } until False; should be: { Got all the information, write it out } CheckNumber := Succ(CheckNumber); until False; Page 221: The Append Procedure ------------------------------ Note: The Append procedure can be used only with TEXT (!) files, not random access files as stated in the text: Assign(FileVar, FileName); Append(FileVar); Writeln(FileVar, 'Append works on existing text files'); Close(FileVar); These four statements add text to the end of an existing text file. Page 225: Advanced Keyboard Handling ------------------------------------ In procedure CheckCommand UpCase(Cmd); { force to upper case } should be: Cmd := UpCase(Cmd); { force to upper case } Page 248: Queues ---------------- procedure GetValue(var Val : integer); should be: procedure GetVal(var Val : integer); Page 248: Queues ---------------- In procedure PutVal Header^.Next := NPtr; should be: Header^.Last:= NPtr; Page 289: Chaining ------------------ Middle of page One more caution is in order. When you select cHn mode on 16-bit systems, another menu will appear allowing you to set code and data segment sizes and specify minimum and maximum memory size required. You can ignore this for now. However, after each .CHN file has compiled, make a note of the code and data printout that comes up on the screen. When you have finished compiling all the .CHN files, select the Com option to compile your main, executable program. When the options menu appears, you must set should be: One more caution is in order. After each .CHN file has compiled, make a note of the code and data printout that comes up on the screen. When you have finished compiling all the .CHN files, select the Com option to compile your main, executable program. When the options menu appears, you must set Page 311: Using Untyped Parameters ---------------------------------- In procedure SwapVars V2[Count] := V1[Count]; { Move value from V2 to V1 } V1[Count] := Tmp; { Store original from V1 to V2 } should be: V1[Count] := V2[Count]; { Move value to V1 from V2 } V2[Count] := Tmp; { Move to V2 from original V1 } Page 315: Place Value --------------------- Note: In the second diagram, the number 00111001 should be shifted to the left two spaces. Page 325: Accessing Parameters From External Subprograms --------------------------------------------------------  Note: On line 2 of the example, indent the ASSUME statement (by one TAB) so it does not begin in column zero. Page 325:$  Accessing Parameters From External Subprograms -------------------------------------------------------- In procedure Simple ADD WORD PTR[DI],AX should be: ADD WORD PTR ES:[DI],AX Page 327: Allocating Local Variable Space ----------------------------------------- Note: Your program code should go just ABOVE the line: ADD SP,LOCALS Page 331: Syntax and Semantics of the Inline Statement ------------------------------------------------------ Middle of page  Parameter of current Offset of parameter value (address procedure or function or function for var parameters) relative to BP should be: Parameter of current Offset of parameter value (address procedure or function for var parameters) relative to BP Page 332: Syntax and Semantics of the Inline Statement ------------------------------------------------------ In procedure VInLine $26/$D0/$1D/ { RCR ES:WORD PTR [DI] } should be: $26/$D0/$1D) { RCR ES:WORD PTR [DI] } Page 388: IBM PC Only --------------------- Last question "Is Turbo Pascal as fast as the regular Turbo compiler?" should be: "Is Turbo-BCD as fast as the regular Turbo compiler?" 4. ANSWERS TO COMMON QUESTIONS ------------------------------ The following answers to common questions are in addition to those provided in Appendix F of the manual: 1. The KeyPressed function doesn't seem to work correctly. How can I get it to work? Answer: Set the C and U compiler directives to {$C-} and {$U-} 2. How can I get the logarithm of a base 10 number? Answer: Use the following function: function Log(Base, Number : integer) : real; { Returns the Base (Base) log of Number } begin Log := Ln(Number) / Ln(Base); end; For example, Log(10, 100) and Log(2, 4) will both return 2.0. 3. How can I take a number to a power in Turbo Pascal? Answer : Use the following function: function Power(X, Y : real) : real; { Returns the value of X to the Y power } begin Power := Exp(Y * Ln(X)); end; 5. FILE LIST ------------ PROGRAM DISK ------------ File Description -------------------------------------------------------------- READ ME - Explains that this file is on the "Source Disk" TUTOR COM - On-line Tutor program QUIZ DTA - Quiz data file for TUTOR.PAS TUTOR HLP - Contains a page of intro. text for TUTOR * EX - Example procedures for TUTOR.PAS SOURCE DISK ----------- File Description -------------------------------------------------------------- README COM - Helps you read the README file TUTORINS COM - Installation program for TUTOR.PAS TUTORINS DTA - Data file for TUTORINS.COM TUTORINS MSG - Message file for TUTORINS.COM TUTOR PAS - Source code for Tutor program WINDOW INC - Include file for TUTOR.PAS QUIZ INC - Include file for TUTOR.PAS DISPLAY INC - Include file fo% r TUTOR.PAS TSCROLL INC - Include file for TUTOR.PAS TUTOR LIB - Library routines for TUTOR.PAS and .EX files  README - This text file! SAMPLE PROGRAMS DISK -------------------- File Description -------------------------------------------------------------- FILEMGR PAS - Source code to DOS utility program FILEMGR INC - Include file for FILEMGR.PAS ANIMALS PAS - Source code to AI program ANIMALS DTA - Data file for ANIMALS.PAS TYPIST PAS - Source code to TYPIST.PAS TYPIST DTA - Data file for TYPIST.PAS LISTT PAS - Source code to file listing program LISTT DOC - Documentation for LISTT * LTP - Printer drivers for LISTT MANUAL PAS - Contains source examples from the manual TBOMOUSE PAS - Routines that show how to use the Microsoft Mouse with Turbo Pascal END ---& ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L