VERSION 2.0 REFERENe MANUAL BORlAnD INTERNATIONAL Borland International 4113 Scotts Valley Drive Scotts Valley, California 95066 Copyright Notice© This software package and manual are copyrighted 1983, 1984 by BORLAND INTERNATIONAL Inc. All rights reserved worldwide. No part of this publication may be reproduced, transmitted, transcribed, stored in any retrieval system, or translated into any language by any means without the express written per­ mission of BORLAND INTERNATIONAL Inc., 4113 Scotts Valley Drive, Scotts Valley, CA 95066, USA. Single CPU License The price paid for one copy of TURBO Pascal licenses you to use the product on one CPU when and only when you have signed and returned the License Agreement printed in this book. Disclaimer Borland International makes no warranties as to the contents of this manual and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose. Borland International further reserves the right to make changes to the specifications of the program and contents of the manual without obligation to notify any person or organization of such changes. Fifth edition, October 1984 Printed in the United States of America 98765 TABLE OF CONTENTS INTRODUCTION ............................................. 1 The Pascal Language .........................................1 TURBO Pascal ..............................................1 Structure of This Manual ..................................... 2 Typography ............................................... 3 Syntax Descriptions ......................................... 4 1. USING THE TURBO SYSTEM ............................ 5 1.1 .COM and .CM D files ..................................... 5 1.2 BEFORE USE ........................................... 5 1.3 Compiler Directive Defaults ................................ 5 1.4 Files On The Distribution Disk .............................. 6 1.5 Starting TURBO Pascal ................................... 7 1.6 Installation ............................................. 8 1.6.1 IBM PC Screen Installation ............................... 8 1.6.2 Non-IBM PC Screen Installation ........................... 9 1.6.3 I nstallation of Editing Commands .......................... 9 1.7 The Menu ............................................. 13 1.7.1 Logged Drive Selection ................................. 14 1.7.2 Work File Selection .................................... 14 1.7.3 Main File Selection .................................... 15 1.7.4 Edit Command ....................................... 1 6 1.7.5 Compile Command .................................... 1 6 1.7.6 Run Command ....................................... 16 1.7.7 Save Command ...................................... 16 1.7.8 eXecute Command .................................... 1 7 1.7.9 Directory Command ................................... 17 1.7.10 Quit Command ...................................... 17 1.7.11 compiler Options ..................................... 17 1.B The TURBO Editor ...................................... 18 1.8.1 The Status Line ....................................... 18 1.8.2 Editing Commands .................................... 19 1.8.3 A Note on Control Characters ............................ 21 1.8.4 Before You Start: HowTo Get Out ........................ 21 1.B.5 Cursor Movement Commands ........................... 21 1.8.5.1 Basic Movement Commands ........................... 21 1.8.5.2 Extended Movement Commands ........................ 24 1.8.6 Insert and Delete Commands ............................ 26 1.8.6.1 I nsert or Overwrite? .................................. 26 1.8.6.2 Simple Insert/Delete Commands ........................ 27 1.8.6.3 Extended Delete Command ............................ 27 TABLE OF CONTENTS I 1.8.7 Block Commands ..................................... 28 1 .8.8 Miscellaneous Editing Commands ........................ 30 1.9 The TURBO editor vs. WordStar ........................... 34 1.9.1 Cursor Movement ..................................... 34 1.9.2 Mark Single Word ..................................... 34 1.9.3 End Edit ..................... " ...................... 35 1.9.4 Line Restore ......................................... 35 1.9.5 Tabulator ............................................ 35 1.9.6 Auto Indentation ...................................... 35 2. BASIC LANGUAGE ELEMENTS ......................... 37 2.1 Basic Symbols ......................................... 37 2.2 Reserved Words .................... "................... 37 2.3 Standard Identifiers ..................................... 38 2.4 Delimiters ............................................ 39 2.5 Program lines .......................................... 39 3. STANDARD SCALAR TYPES ........................... 41 3.1 Integer ............................................... 41 3.2 Byte ................................................. 41 3.3 Real ................................................. 42 3.4 Boolean .............................................. 42 3.5 Char ................................................. 42 4. USER DEFINED LANGUAGE ELEMENTS ................ 43 4.1 Identifiers ............................................. 43 4.2 Numbers ............................................. 43 4.3 Strings ............................................... 44 4.3.1 Control Characters .................................... 45 4.4 Comments ............................................ 45 4.5 Compiler Directives ..................................... 46 5. PROGRAM HEADING AND PROGRAM BLOCK ........... 47 5.1 Program Heading ....................................... 47 5.2 Declaration Part ........................................ 47 5.2.1 Label Declaration Part ................................. 48 5.2.2 Constant Definition Part ................................ 48 5.2.3 Type Definition Part ................................... 49 5.2.4 Variable Declaration Part ............................... 49 5.2.5 Procedure and Function Declaration Part ................... 50 5.3 Statement Part ........................................ 50 II TURBO Pascal Language Manual 6. EXPRESSIONS ....................................... 51 6.1 Operators ............................................. 51 6.1.1 UnaryMinus ......................................... 51 6.1.2 Not Operator ......................................... 52 6.1.3 Multiplying Operators ....................... " ......... 52 6.1.4 Adding Operators ..................................... 53 6.1.5 RelationaIOperators ................................... 53 6.2 Function Designators .................................... 54 7. STATEMENTS ........................................ 55 7.1 Simple Statements ..................................... 55 7.1.1 Assignment Statement ................................. 55 7.1.2 Procedure Statement .................................. 56 7.1.3 Goto Statement ...................................... 56 7.1.4 Empty Statement ..................................... 56 7.2 Structured Statements .................................. 57 7.2.1 Compound Statement .................................. 57 7.2.2 Conditional Statements ................................ 57 7.2.2.1 If Statement ........................................ 57 7.2.2.2 Case Statement ..................................... 58 7.2.3 Repetitive Statements ................................. 59 7.2.3.1 For Statement ...................................... 60 7.2.3.2 While statement .................................... 61 7.2.3.3 Repeat Statement ................................... 61 8. SCALAR AND SUBRANGE TYPES ....................... 63 8.1 ScalarType ........................................... 63 8.2 Subrange Type ......................................... 64 8.3 Type Conversion ....................................... 65 8.4 Range Checking ........................................ 65 9. STRI NG TYPE ......................................... 67 9.1 String Type Definition ................................... 67 9.2 String Expressions ...................................... 67 9.3 String Assignment ...................................... 68 9.4 String Procedures ...................................... 69 9.4.1 Delete .............................................. 69 9.4.2 Insert .............................................. 69 9.4.3 Str ................................................. 70 9.4.4 Val ................................................ 70 TABLE OF CONTENTS III 9.5 String Functions ....................................... 71 9.5.1 Copy ............................................... 71 9.5.2 Concat ............................................. 71 9.5.3 Length ............................................. 72 9.5.4 Pos ................................................ 72 9.6 Strings and Characters .......................•.......... 73 10. ARRAY TYPE .•..•.•••••.•.••.••.•.•••••.••••••.••••.. 75 10.1 Array Definition ....................................... 75 10.2 Multidimensional Arrays ................................ 76 10.3 Character Arrays ...................................... 77 10.4 Predefined Arrays ..................................... 77 11. RECORD TYPE ••••••.•••••••••••..••••.••••••.••••.•• 79 11.1 Record Definition ...................................... 79 11.2 With Statement .......•............................... 81 11.3 Variant Records ....................................... 82 12. SET TYPE ••••••.••••.•••••..•.•...••••.••••••••.••••• 85 12.1 Set Type Definition ...................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages326 Page
-
File Size-