BORLAND Turbo Pasca~

BORLAND Turbo Pasca~

6.0 PROGRAMMfR 'S GUIDf .. BORLAND Turbo Pasca~ Version 6.0 Programmeris· Guide BORLAND INTERNATIONAL INC. 1800 GREEN HILLS ROAD P.O. BOX 660001, SCOTTS VALLEY, CA 95067-0001 Copyright © 1983, 1990 by Borland International. All rights reserved. All Borland products are trademarks or registered trademarks of Borland International, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. PRINTED IN THE USA. R2 10 9 8 7 6 5 4 3 2 1 c o N T E N T s Introduction 1 Object types . .. 32 What's in this manual . .. 1 Components and scope ........... 35 Methods ........................ 35 Part 1 The Turbo Pascal standard Virtual methods ................. 36 Chapter 1 Tokens and constants 5 Instantiating objects .............. 36 Special symbols and reserved words . .. 5 Set types . .. 38 Identifiers . .. 7 File types ......................... 39 Labels ............................... 8 Pointer types ........................ 39 Numbers ............................ 9 Procedural types ..................... 40 Character strings . .. 10 Identical and compatible types ......... 41 Constant declarations ................ 12 Type identity ...................... 41 Comments .......................... 13 Type compatibility ... .. 42 Program lines ....................... 13 Assignment compatibility . .. 43 The type declaration part ............. 44 Chapter 2 Blocks, locality, and scope 15 Chapter 4 Variables 47 Syntax .............................. 15 Variable declarations ................. 47 Rules of scope ....................... 17 The data segment . .. 48 Scope of interface and standard The stack segment ................. 48 identifiers . .. 18 Absolute variables ................. 49 Variable references . .. 50 Chapter 3 Types 21 Qualifiers . .. 50 Simple types ........................ 22 Arrays, strings, and indexes ......... 51 Ordinal types . .. 22 Records and field designators. .. 52 Integer types .................... 23 Object component designators ....... 52 Boolean types ................... 24 Pointers and dynamic variables .... .. 53 Char type ....................... 24 Variable typecasts . .. 53 Enumerated types ................ 25 Subrange types .................. 25 Chapter 5 Typed constants 57 Real types . .. 26 Simple-type constants ................ 58 Software floating point ........... 27 String-type constants ...... .. 59 8087 floating point ............... 27 Structured-type constants ............. 59 String types ......................... 27 Array-type constants ............... 59 Structured types ..................... 28 Record-type constants .............. 60 Array types ....................... 29 Object-type constants . .. 61 Record types ...................... 30 Set-type constants . .. 62 Pointer-type constants ................ 62 Procedural-type constants . .. 63 For statements . .. 90 With statements ................... 92 Chapter 6 Expressions 65 Expression syntax .................... 66 Chapter 8 Procedures and functions 95 Operators ........................... 69 Procedure declarations ............... 95 Arithmetic operators ............... 69 Near and far declarations ........... 97 Logical operators .................. 70 Interrupt declarations .............. 97 Boolean operators . .. 70 Forward declarations . .. 98 String operator .................... 72 External declarations ............... 99 Set operators ...................... 72 Assembler declarations ............. 99 Relational operators ................ 72 Inline declarations ................. 99 Comparing simple types .......... 73 Function declarations ................ 100 Comparing strings ............... 73 Method declarations ................ 102 Comparing packed strings ........ 74 Constructors and destructors ....... 103 Comparing pointers ............ .. 74 Parameters . .. 105 Comparing sets .................. 74 Value parameters ................. 106 Testing set membership ........... 74 Variable parameters ............... 106 The@operator .................... 74 Objects ........................ 107 @ with a variable. .. .. .. .. 75 Untyped variable parameters ....... 107 @ with a value parameter ......... 75 Procedural types . .. 108 @ with a variable parameter ....... 75 Procedural variables .............. 108 @ with a procedure or function .... 76 Procedural-type parameters ........ 111 @ with a method . .. 76 Chapter 9 Programs and units 113 Function calls ....................... 76 Set constructors . .. 77 Program syntax. .. 113 Value typecasts ... .. 78 The program heading ............. 113 Procedural types in expressions ........ 79 The uses clause ................... 114 Unit syntax ........................ 114 Chapter 7 Statements 81 The unit heading . .. 115 Simple statements. .. 81 The interface part ................. 115 Assignment statements ............. 82 The implementation part . .. 116 Object type assignments .......... 82 The initialization part. .. 117 Procedure statements ............... 83 Indirect unit references ............ 117 Method, constructor, and destructor Circular unit references ............ 118 calls ............................ 83 Sharing other declarations ....... 120 Goto statements ................... 84 Part 2 The standard libraries Structured statements ................ 85 Compound statements . .. 85 Chapter 10 The System unit 125 Conditional statements ............. 86 Standard procedures and functions .... 125 If statements .................... 86 Flow control procedures ......... 125 Case statements. .. 87 Dynamic allocation procedures ... 125 Repetitive statements . .. 88 Dynamic allocation functions ..... 126 Repeat statements . .. 88 Transfer functions ............... 126 While statements ................ 89 Arithmetic functions ............ 127 ii Ordinal procedures ............. 127 Interrupt support procedures ..... 146 Ordinal functions ............... 127 Disk status functions ............ 146 String procedures ............... 127 File-handling procedures ........ 146 String functions . .. 128 File-handling functions .......... 146 Pointer and address functions .... 128 Process-handling procedures ..... 146 Miscellaneous procedures ........ 128 Process-handling functions ....... 147 Miscellaneous functions ......... 129 Environment-handling functions .. 147 File input and output . .. 129 Miscellaneous procedures ........ 147 An introduction to file I/O ......... 129 Miscellaneous functions ......... 147 I/O functions ................... 130 Chapter 12 The Graph unit 149 I/O procedures ................. 131 Text files . .. 131 Drivers ............................ 149 Procedures ..................... 132 IBM 8514 support . .. .. 150 Functions ...................... 132 Coordinate system ................ 151 Untyped files . .. 133 Current pointer . .. 152 Procedures ..................... 133 Text ............................... 152 The FileMode variable ....... .. 133 Figures and styles ................... 153 Devices in Turbo Pascal .............. 134 Viewports and bit images .......... 153 DOS devices ..................... 134 Paging and colors ... .. 154 The CON device ................ 135 Error handling. .. 154 The LPT1, LPT2, and LPT3 devices. 135 Getting started ..................... 155 The COM1 and COM2 devices . .. 135 Heap management routines ........ 156 The NUL device ................ 136 Graph unit constants, types, and Text file devices ................... 136 variables . .. 159 Predeclared variables . .. 136 Constants . .. 159 Uninitialized variables . .. 136 SetPalette and SetAIlPalette ...... 160 Initialized variables ............. 137 SetRGBPalette .................. 161 Line style constants ............. 161 Chapter 11 The Dos unit 141 Font control constants ........... 161 Constants, types, and variables ....... 141 Justification constants ........... 161 Constants ........................ 141 Clipping constants .............. 162 Flag constants .................. 141 Bar constants . .. 162 File mode constants ............. 142 Fill pattern constants ............ 162 File attribute constants ........... 142 BitBlt operators ................. 163 Types ........................... 143 Palette constant ................. 163 File record types ................ 143 Types ........................... 163 The Registers type .............. 143 Variables ........................ 165 The DateTime type .............. 144 Chapter 13 The Overlay unit 169 The SearchRec type ............. 144 File-handling string types ........ 144 The overlay manager ................ 170 Variables ........................ 145 Overlay buffer management ........ 171 The DosError variable ........... 145 Constants and variables ............. 173 Procedures and functions ............ 145 OvrResult . .. 174 Date and time procedures ........ 145 OvrTrapCount ................... 174 iii OvrLoadCount ................... 174 CheckSnow .................... 203 OvrFileMode . .. 174 DirectVideo .................... 204 OvrReadBuf ...................... 175 LastMode . .. 204 Result codes ...................... 177 TextAttr ....................... 204 Procedures and functions ............ 177 WindMin and WindMax . .. 205 OvrInit .......................... 177 Procedures and functions ............ 205 OvrInitEMS . .. 177 OvrSetBuf ....................... 178 Part 3 Inside Turbo Pascal OvrGetBuf ....................... 178 Chapter 16 Memory issues 209 OvrClearBuf ..................... 178 The Turbo Pascal memory map ....... 209 OvrSetRetry . .. 179 The heap manager .................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    382 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us