"Cover" 1 "License Statement" 2 "Title & Copyright" 3 "TABLE OF CONTENTS" 5 "LIST OF FIGURES" 21 "1-1 Log-on Message" 32 "1-2 Main Menu" 33 "1-3 Installation Main Menu" 34 "1-4 Main Menu" 36 "1-5 Editor Status Line" 41 "15-1 Using Dispose" 146 "18-1 Principle of Overlay System" 171 "18-2 Largest Overlay Subprogram Loaded" 172 "18-3 Smaller Overlay Subprogram Loaded" 173 "18-4 Multiple Overlay Files" 175 "18-5 Nested Overlay Files" 176 "19-1 Text Windows" 191 "19-2 Graphics Windows" 192 "19-3 Turtle Coordinates" 200 "19-4 Turtle Coordinates" 205 "20-1 TURBO Main Menu under DOS 2.0" 209 "20-2 Options Menu" 212 "20-3 Memory Usage Menu" 213 "20-4 Run-time Error Message" 214 "20-5 Find Run-time Error" 214 "21-1 Options Menu" 249 "21-2 Memory Usage Menu" 250 "21-3 Run-time Error Message" 252 "21-4 Find Run-time Error" 252 "22-1 Options Menu" 282 "22-2 Start and End Addresses" 283 "22-3 Run-time Error Message" 284 "22-4 Find Run-time Error" 284 "22-5 Memory map during compilation in memory" 310 "22-6 Memory map during compilation to a file" 311 "22-7 Memory map during execution in direct mode" 312 "22-8 Memory map during execution of a program file" 313 "L-1 IBM PC Screen Installation Menu" 367 "L-2 Terminal Installation Menu" 368 "LIST OF TABLES" 22 "1-1 Editing Command Overview" 43 "14-1 Operation of EOLN and Eof" 127 "19-1 Text Mode Color Scale" 183 "19-2 High Resolution Graphics Color Scale" 187 "19-3 Color Palettes in Color Graphics" 187 "19-4 Color Palettes in B/W Graphics" 188 "19-5 Graphics Background Color Scale" 189 "19-6 IBM PC Keyboard Editing Keys" 208 "K-1 Keyboard Return Codes" 365 "L-1 Secondary Editing Commands" 375 "INTRODUCTION" 23 "The Pascal Language" 23 "TURBO Pascal" 23 "Structure of This Manual" 24 "Typography" 26 "Syntax Descriptions" 26 "Chapter 1. USING THE TURBO SYSTEM" 29 ".COM and .CMD files" 29 "BEFORE USE" 29 "IMPORTANT NOTE !!!" 29 "Files On The Distribution Disk" 30 "Starting TURBO Pascal" 32 "Installation" 34 "IBM PC Screen Installation" 34 "Non-IBM PC Screen Installation" 34 "Installation of Editing Commands" 35 "The Menu" 36 "Logged Drive Selection" 37 "Work File Selection" 37 "Main File Selection" 38 "Edit Command" 39 "Compile Command" 39 "Run Command" 39 "Save Command" 39 "Directory Command" 40 "Quit Command" 40 "compiler Options" 40 "The TURBO Editor" 41 "The Status Line" 41 "Editing Commands" 42 "A Note on Control Characters" 44 "Before You Start: How To Get Out" 44 "Basic Movement Commands" 44 "Extended Movement Commands" 47 "Insert and Delete Commands" 48 "Block Commands" 50 "Miscellaneous Editing Commands" 52 "The TURBO editor vs. WordStar" 56 "Cursor Movement" 56 "Mark Single Word" 56 "End Edit" 57 "Line Restore" 57 "Tabulator" 57 "Auto Indentation" 57 "Chapter 2. BASIC LANGUAGE ELEMENTS" 59 "Basic Symbols" 59 "Reserved Words" 59 "Standard Identifiers" 60 "Delimiters" 61 "Program Lines" 61 "Chapter 3. STANDARD SCALAR TYPES" 63 "Integer" 63 "Byte" 63 "Real" 64 "Boolean" 64 "Char" 64 "Chapter 4. USER DEFINED LANGUAGE ELEMENTS" 65 "Identifiers" 65 "Numbers" 65 "Strings" 66 "Control Characters" 67 "Comments" 68 "Compiler Directives" 68 "Chapter 5. PROGRAM HEADING AND PROGRAM BLOCK" 69 "Program Heading" 69 "Declaration Part" 69 "Label Declaration Part" 70 "Constant Definition Part" 70 "Type Definition Part" 71 "Variable Declaration Part" 71 "Procedure and Function Declaration Part" 72 "Statement Part" 72 "Chapter 6. EXPRESSIONS" 73 "Operators" 73 "Unary Minus" 73 "Not Operator" 74 "Multiplying Operators" 74 "Adding Operators" 75 "Relational Operators" 75 "Function Designators" 76 "Chapter 7. STATEMENTS" 77 "Simple Statements" 77 "Assignment Statement" 77 "Procedure Statement" 78 "Goto Statement" 78 "Empty Statement" 78 "Structured Statements" 79 "Compound Statement" 79 "Conditional Statements" 79 "If Statement" 79 "Case Statement" 80 "Repetitive Statements" 81 "For Statement" 82 "While statement" 83 "Repeat Statement" 83 "Chapter 8. SCALAR AND SUBRANGE TYPES" 85 "Scalar Type" 85 "Subrange Type" 86 "Type Conversion" 87 "Range Checking" 87 "Chapter 9. STRING TYPE" 89 "String Type Definition" 89 "String Expressions" 89 "String Assignment" 90 "String Procedures" 91 "Delete" 91 "Insert" 91 "Str" 92 "Val" 92 "String Functions" 93 "Copy" 93 "Coneat" 93 "Length" 94 "Pos" 94 "Strings and Characters" 95 "Chapter 10. ARRAY TYPE" 97 "Array Definition" 97 "Multidimensional Arrays" 98 "Character Arrays" 99 "Predefined Arrays" 99 "Chapter 11. RECORD TYPE" 101 "Record Definition" 101 "With Statement" 103 "Variant Records" 104 "Chapter 12. SET TYPE" 107 "Set Type Definition" 107 "Set Expressions" 108 "Set Constructors" 108 "Set Operators" 109 "Set Assignments" 110 "Chapter 13. TYPED CONSTANTS" 111 "Unstructured Typed Constants" 111 "Structured Typed Constants" 112 "Array Constants" 112 "Multi-dimensional Array Constants" 113 "Record Constants" 113 "Set Constants" 114 "Chapter 14. FILE TYPES" 115 "File Type Definition" 115 "Operations on Files" 116 "Assign" 116 "Rewrite" 116 "Reset" 116 "Read" 117 "Write" 117 "Seek" 117 "Flush" 118 "Close" 118 "Erase" 118 "Rename" 118 "File Standard Functions" 119 "EOF" 119 "FilePos" 119 "FileSize" 120 "Using Files" 120 "Text Files" 123 "Operations on Text Files" 123 "ReadLn" 123 "WriteLn" 123 "Eoln" 124 "SeekEoln" 124 "SeekEof" 124 "Logical Devices" 126 "Standard Files" 127 "Text Input and Output" 130 "Read Procedure" 130 "Readln Procedure" 132 "Write Procedure" 133 "Write Parameters" 134 "Writeln Procedure" 135 "Untyped Files" 136 "BlockRead / BlockWrite" 136 "I/O checking" 138 "Chapter 15. POINTER TYPES" 141 "Defining a Pointer Variable" 141 "Allocating Variables (New)" 142 "Mark and Release" 143 "Using Pointers" 144 "Dispose" 146 "GetMem" 147 "FreeMem" 147 "MaxAvail" 148 "Chapter 16. PROCEDURES AND FUNCTIONS" 149 "Parameters" 149 "Relaxations on Parameter Type Checking" 151 "Untyped Variable Parameters" 152 "Procedures" 153 "Procedure Declaration" 153 "Standard Procedures" 155 "ClrEol" 155 "ClrScr" 155 "CrtInit" 155 "CrtExit" 156 "Delay" 156 "DelLine" 156 "InsLine" 156 "GotoXY" 156 "Exit" 157 "Halt" 157 "LowVideo" 157 "NormVideo" 157 "Randomize" 157 "Move" 158 "FillChar" 158 "Functions" 159 "Function Declaration" 159 "Standard Functions" 161 "Arithmetic Functions" 161 "Abs" 161 "ArcTan" 161 "Cos" 161 "Exp" 162 "Frac" 162 "Int" 162 "Ln" 162 "Sin" 162 "Sqr" 163 "Sqrt" 163 "Scalar Functions" 163 "Pred" 163 "Succ" 163 "Odd" 163 "Transfer Functions" 164 "Chr" 164 "Ord" 164 "Round" 164 "Trunc" 164 "Miscellaneous Standard Functions" 165 "Hi" 165 "KeyPressed" 165 "Lo" 165 "Random" 165 "Random(Num)" 166 "ParamCount" 166 "ParamStr" 166 "SizeOf" 166 "Swap" 166 "UpCase" 166 "Forward References" 167 "Chapter 17. INCLUDING FILES" 169 "Chapter 18. OVERLAY SYSTEM" 171 "Creating Overlays" 174 "Nested Overlays" 176 "Automatic Overlay Management" 177 "Placing Overlay Files" 177 "Efficient Use of Overlays" 177 "Restrictions Imposed on Overlays" 178 "Data Area" 178 "Forward Declarations" 178 "Recursion" 178 "Externals" 178 "Run-Time Errors" 178 "Chapter 19. IBM PC GOODIES" 181 "Screen Mode Control" 182 "Text Modes" 182 "Color Modes" 183 "TextColor" 183 "TextBackground" 184 "Cursor Position" 184 "WhereX" 184 "WhereY" 184 "Graphics Modes" 185 "GraphColorMode" 185 "GraphMode" 186 "HiRes" 186 "HiResColor" 186 "Palette" 187 "GraphBackground" 188 "Windows" 190 "Text Windows" 190 "Graphics Windows" 191 "Basic Graphics" 193 "Plot" 193 "Draw" 193 "Extended Graphics" 194 "ColorTable" 194 "Arc" 195 "Circle" 195 "GetPic" 195 "PutPic" 196 "GetDotColor" 196 "FillScreen" 197 "FillShape Procedure" 197 "FillPattern" 197 "Pattern" 198 "Turtlegraphics" 199 "Back" 200 "ClearScreen" 201 "Forward" 201 "Heading" 201 "HideTurtle" 201 "Home" 201 "NoWrap" 202 "PenDown" 202 "PenUp" 202 "SetHeading" 202 "SetPenColor" 203 "SetPosition" 203 "ShowTurtle" 203 "TurnLeft" 203 "TurnRight" 203 "TurtleWindow" 204 "TurtleThere" 205 "TurtleDelay" 205 "Wrap" 206 "Xcor" 206 "Ycor" 206 "Sound" 207 "Editor Command Keys" 208 "Chapter 20. PC-DOS AND MS-DOS" 209 "Tree-Structured Directories" 209 "On the Main Menu" 209 "Directory-related procedures" 211 "ChDir" 211 "MkDir" 211 "RmDir" 211 "GetDir" 211 "Compiler Options" 212 "Memory / Com file / cHn-file" 212 "Minimum Code Segment Size" 213 "Minimum Data Segment Size" 213 "Minimum Free Dynamic Memory" 214 "Maximum Free Dynamic Memory" 214 "Command Line Parameter" 214 "Find Run-time Error" 214 "Standard Identifiers" 215 "Chain and Execute" 215 "Overlays" 218 "OvrPath Procedure" 218 "Files" 220 "File Names" 220 "Number of Open Files" 220 "Extended File Size" 221 "File of Byte" 221 "Untyped Files" 222 "Flush Procedure" 222 "Truncate Procedure" 222 "Text Files" 222 "Buffer Size" 222 "Append Procedure" 223 "Flush Procedure" 223 "Logical Devices" 223 "I/O redirection" 224 "Absolute Variables" 225 "Absolute Address Functions" 226 "Addr" 226 "Ofs" 227 "Seg" 227 "Cseg" 227 "Dseg" 227 "Sseg" 227 "Predefined Arrays" 228 "Mem Array" 228 "Port Array" 228 "With Statements" 229 "Pointer Related Items" 229 "MemAvail" 229 "Pointer Values" 229 "Assigning a Value to a Pointer" 229 "Obtaining The Value of a Pointer" 229 "DOS Function Calls" 230 "User Written I/O Drivers" 231 "External Subprograms" 232 "In-line Machine Code" 233 "Interrupt Handling" 236 "Intr procedure" 237 "Internal Data Formats" 238 "Basic Data Types" 238 "Scalars" 238 "Reals" 239 "Strings" 239 "Sets" 240 "Pointers" 240 "Data Structures" 241 "Arrays" 241 "Records" 241 "Disk Files" 242 "File Interface Blocks" 242 "Random Access Files" 243 "Text Files" 243 "Parameters" 243 "Variable Parameters" 245 "Value Parameters" 245 "Scalars" 245 "Reals" 245 "Strings" 245 "Sets" 246 "Pointers" 246 "Arrays and Records" 246 "Function Results" 246 "The Heap and The Stacks" 247 "Memory Management" 248 "Chapter 21. CP/M-86" 249 "Compiler Options" 249 "Memory / Cmd file / cHn-file" 249 "Minimum Code Segment Size" 250 "Minimum Data Segment Size" 251 "Minimum Free Dynamic Memory" 251 "Maximum Free Dynamic Memory" 251 "Command Line Parameter" 251 "Find Runtime Error" 251 "Standard Identifiers" 252 "Chain and Execute" 253 "Overlays" 255 "OverDrive Procedure" 255 "Files" 257 "File Names" 257 "Text Files" 257 "Buffer Size" 257 "Absolute Variables" 258 "Absolute Address Functions" 259 "Addr" 259 "Ofs" 259 "Seg" 259 "Cseg" 259 "Dseg" 260 "Sseg" 260 "Predefined Arrays" 260 "Mem Array" 260 "Port Array" 261 "With Statements" 261 "Pointer Related Items" 261 "MemAvail" 261 "Pointer Values" 261 "Assigning a Value to a Pointer" 262 "Obtaining The Value of a Pointer" 262 "Function Calls" 262 "User Written I/O Drivers" 263 "External Subprograms" 264 "In-line Machine Code" 265 "Interrupt Handling" 267 "Intr procedure" 267 "Internal Data Formats" 268 "Basic Data Types" 268 "Scalars" 269 "Reals" 269 "Strings" 270 "Sets" 270 "Pointers" 271 "Data Structures" 271 "Arrays" 271 "Records" 272 "Disk Files" 272 "File Interface Blocks" 272 "Random Access Files" 273 "Text Files" 274 "Parameters" 274 "Variable Parameters" 275 "Value Parameters" 275 "Scalars" 276 "Reals" 276 "Strings" 276 "Sets" 276 "Pointers" 276 "Arrays and Records" 276 "Function Results" 277 "The Heap and The Stacks" 277 "Memory Management" 278 "Chapter 22. CP/M-80" 281 "eXecute Command" 281 "compiler Options" 281 "Memory / Com file / cHn-file" 282 "Start Address" 283 "End Address" 283 "Find Runtime Error" 284 "Standard Identifiers" 285 "Chain and Execute" 285 "Overlays" 287 "OvrDrive Procedure" 287 "Files" 289 "File Names" 289 "Text Files" 289 "Absolute Variables" 289 "Addr" 290 "Predefined Arrays" 290 "Mem Array" 290 "Port Array" 291 "Array Subscript Optimization" 291 "With Statements" 291 "Pointer Related Items" 292 "MemAvail" 292 "Pointers and Integers" 292 "CP/M Function Calls" 293 "Bdos procedure and function" 293 "BdosHL function" 293 "Bios procedure and function" 294 "BiosHL function" 294 "User Written I/O Drivers" 294 "External Subprograms" 296 "In-line Machine Code" 296 "Interrupt Handling" 299 "Internal Data Formats" 300 "Basic Data Types" 300 "Scalars" 300 "Reals" 300 "Strings" 301 "Sets" 301 "File Interface Blocks" 302 "Pointers" 303 "Data Structures" 303 "Arrays" 303 "Records" 304 "Disk Files" 304 "Random Access Files" 304 "Text Files" 305 "Parameters" 305 "Variable Parameters" 305 "Value Parameters" 305 "Scalars" 305 "Reals" 306 "Strings" 306 "Sets" 306 "Pointers" 307 "Arrays and Records" 307 "Function Results" 307 "The Heap and The Stacks" 308 "Memory Management" 310 "Memory Maps" 310 "Compilation in Memory" 310 "Compilation To Disk" 311 "Execution in Memory" 312 "Execution of a Program File" 313 "Chapter 23. TURBO BCD PASCAL" 315 "Files On the TURBO BCD Pascal Distribution Diskette" 315 "BCD Range" 315 "Form function" 316 "Numeric Fields" 316 "String Fields" 319 "Writing BCD Reals" 319 "Formatted Writing" 320 "Internal Data Format" 320 "Chapter 24. TURBO-87" 323 "Files On the TURBO-87 Distribution Diskette" 323 "Writing 8087 Reals" 324 "Internal Data Format" 324 "Appendix A. SUMMARY OF PROCEDURES AND FUNCTIONS" 325 "Input/Output Procedures and Functions" 325 "Arithmetic Functions" 326 "File-Handling Routines" 326 "Heap Control Procedures and Functions" 326 "Miscellaneous Procedures and Functions" 327 "Scalar Functions" 328 "Directory-Related Procedures (PC/MS-DOS)" 328 "Screen-Related Procedures and Functions" 328 "String Procedures and Functions" 329 "Transfer Functions" 329 "IBM PC Procedures and Functions" 329 "Basic Graphics, Windows, and Sound" 329 "Extended Graphics" 330 "Turtlegraphics" 330 "Appendix B. SUMMARY OF OPERATORS" 333 "Appendix C. SUMMARY OF COMPILER DIRECTIVES" 335 "IMPORTANT NOTICE" 335 "Common Compiler Directives" 336 "B - I/O Mode Selection" 336 "C - Control C and S" 336 "I - I/O Error Handling" 336 "I - Include Files" 336 "R - Index Range Check" 337 "V - Var-parameter Type Checking" 337 "U - User interrupt" 337 "PC-DOS, MS-DOS Compiler Directives" 338 "G - Input File Buffer" 338 "P - Output File Buffer" 338 "D - Device Checking" 338 "F - Number of Open Files" 339 "PC-DOS, MS-DOS, and CP/M-86 Compiler Directive" 339 "K - Stack Checking" 340 "CP/M-80 Compiler Directives" 340 "A - Absolute Code" 340 "W - Nesting of With Statements" 340 "X - Array Optimization" 340 "Appendix D. TURBO VS. STANDARD PASCAL" 341 "Recursion" 341 "Get and Put" 341 "Goto Statements" 341 "Page Procedure" 341 "Packed Variables" 342 "Procedural Parameters" 342 "Appendix E. COMPILER ERROR MESSAGES" 343 "Appendix F. RUN-TIME ERROR MESSAGES" 347 "Appendix G. I/O ERROR MESSAGES" 349 "Appendix H. TRANSLATING ERROR MESSAGES" 351 "Error Message File Listing" 352 "Appendix I. TURBO SYNTAX" 352 "Appendix J. ASCII TABLE" 361 "Appendix K. KEYBOARD RETURN CODES" 363 "Appendix L. INSTALLATION" 367 "Terminal installation" 367 "IBM PC Display Selection" 367 "Non-IBM PC Installation" 368 "Editing Command Installation" 372 "Appendix M. CP/M PRIMER" 377 "How to use TURBO on a CP/M system" 377 "Copying Your TURBO Disk" 377 "Using Your TURBO Disk" 378 "Appendix N. HELP!!!" 379 "INDEX" 399 "A-C" 399 "C-E" 400 "E-F" 401 "F-H" 402 "H-M" 403 "M-P" 404 "P" 405 "P-S" 406 "S-V" 407 "V-Y & 0-9" 408 "Borland Software (Product Catalog)" 409 "SideKick" 410 "SideKick 2.0 for the Mac" 411 "Traveling SideKick" 412 "SuperKey" 413 "Turbo Lightning" 414 "Lightning Word Wizard" 415 "Reflex" 416 "Reflex for the Mac" 417 "Reflex Workshop" 418 "Turbo Pascal 3.0" 419 "Turbo Pascal for the Mac" 420 "Turbo Tutor" 421 "Turbo Database Toolbox" 422 "Turbo Pascal Graphix Toolbox" 423 "Turbo Editor Toolbox" 424 "Turbo GameWorks" 425 "Turbo Pascal Numerical Methods Toolbox" 426 "Turbo Prolog" 427 "Turbo Basic" 428 "Eureka" 429 "Borland Software ORDER TODAY" 430 "EDITOR QUICK REFERENCE" 435 "Turbo Pascal 3.0 Advert" 436 "EDITOR QUICK REFERENCE" 437 "Turbo Pascal 3.0 Advert" 438