وبلاگ بلیان

Borland - Object Pascal Language Guide

معرفی کتاب «Borland - Object Pascal Language Guide» نوشتهٔ Unknown. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Borland - Object Pascal Language Guide» در دستهٔ بدون دسته‌بندی قرار دارد.

Object Pascal Language Guide......Page 1 Contents......Page 3 Tables......Page 7 Using Object Pascal......Page 9 Other sources of information......Page 10 Software registration and technical support......Page 11 Part I: Basic language description......Page 13 Pascal source files......Page 15 Other files used to build applications......Page 16 A simple console application......Page 17 A more complicated example......Page 18 A native application......Page 19 Program structure and syntax......Page 23 The block......Page 24 The unit heading......Page 25 The initialization section......Page 26 Unit references and the uses clause......Page 27 Multiple and indirect unit references......Page 28 Circular unit references......Page 29 Fundamental syntactic elements......Page 31 Qualified identifiers......Page 32 Directives......Page 33 Character strings......Page 34 Expressions......Page 35 Arithmetic operators......Page 36 Boolean operators......Page 37 Logical (bitwise) operators......Page 38 Pointer operators......Page 39 Relational operators......Page 40 Class operators......Page 41 Operator precedence rules......Page 42 Set constructors......Page 43 Value typecasts......Page 44 Variable typecasts......Page 45 Declarations......Page 46 Assignment statements......Page 47 Goto statements......Page 48 Structured statements......Page 49 With statements......Page 50 If statements......Page 52 Case statements......Page 53 While statements......Page 55 For statements......Page 56 Blocks......Page 57 Scope......Page 58 Naming conflicts......Page 59 About types......Page 61 Ordinal types......Page 62 Integer types......Page 63 Boolean types......Page 65 Enumerated types......Page 66 Subrange types......Page 68 Real types......Page 69 String types......Page 70 Long strings......Page 72 Working with null-terminated strings......Page 73 Using pointers, arrays, and string constants......Page 74 Mixing Pascal strings and null-terminated strings......Page 75 Structured types......Page 76 Sets......Page 77 Static arrays......Page 78 Dynamic arrays......Page 79 Records......Page 81 Variant parts in records......Page 82 File types......Page 84 Overview of pointers......Page 85 Other standard pointer types......Page 87 Procedural types......Page 88 Procedural types in statements and expressions......Page 89 Variant types......Page 90 Variant type conversions......Page 91 Variant arrays......Page 93 Type identity......Page 94 Assignment-compatibility......Page 95 Declaring types......Page 96 Declaring variables......Page 97 Thread-local variables......Page 98 True constants......Page 99 Resource strings......Page 101 Typed constants......Page 102 Record constants......Page 103 Pointer constants......Page 104 Declaring procedures and functions......Page 107 Procedure declarations......Page 108 Function declarations......Page 109 Calling conventions......Page 110 Forward and interface declarations......Page 111 Linking to object files......Page 112 Importing functions from libraries......Page 113 Overloading procedures and functions......Page 114 Nested routines......Page 116 Parameter semantics......Page 117 Value and variable parameters......Page 118 Out parameters......Page 119 Untyped parameters......Page 120 Open array parameters......Page 121 Variant open array parameters......Page 122 Default parameters......Page 123 Default parameters and overloaded routines......Page 124 Open array constructors......Page 125 7: Classes and objects......Page 127 Class types......Page 128 Compatibility of class types......Page 129 Visibility of class members......Page 130 Published members......Page 131 Forward declarations and mutually dependent classes......Page 132 Fields......Page 133 Method declarations and implementations......Page 134 Self......Page 135 Virtual and dynamic methods......Page 136 Overloading methods......Page 138 Constructors......Page 139 Destructors......Page 140 Message methods......Page 141 Message dispatching......Page 142 Property access......Page 143 Array properties......Page 145 Index specifiers......Page 146 Storage specifiers......Page 147 Property overrides and redeclarations......Page 148 Class-reference types......Page 149 The is operator......Page 150 Class methods......Page 151 When to use exceptions......Page 152 Raising and handling exceptions......Page 153 Try...except statements......Page 154 Re-raising exceptions......Page 156 Try...finally statements......Page 157 Standard exception classes and routines......Page 158 File input and output......Page 159 Text files......Page 161 Text-file device drivers......Page 162 The InOut function......Page 163 Handling null-terminated strings......Page 164 Other standard routines......Page 165 Part II: Special topics......Page 169 Static loading......Page 171 Dynamic loading......Page 172 Writing dynamically loadable libraries......Page 173 Library initialization code......Page 175 Libraries and system variables......Page 176 Exceptions and runtime errors in libraries......Page 177 Packages......Page 178 Package declarations and source files......Page 179 The contains clause......Page 180 Package-specific compiler directives......Page 181 Package-specific command-line compiler switches......Page 182 Interface types......Page 183 IInterface and inheritance......Page 184 Calling conventions for interfaces......Page 185 Implementing interfaces......Page 186 Method resolution clauses......Page 187 Implementing interfaces by delegation......Page 188 Delegating to a class-type property......Page 189 Interface references......Page 190 Interface assignment-compatibility......Page 191 Dispatch interface types (Windows only)......Page 192 Accessing Automation objects (Windows only)......Page 193 Automation object method-call syntax......Page 194 Dual interfaces (Windows only)......Page 195 The memory manager (Windows only)......Page 197 Internal data formats......Page 198 Enumerated types......Page 199 The Single type......Page 200 Short string types......Page 201 Wide string types......Page 202 Dynamic array types......Page 203 File types......Page 204 Class types......Page 206 Variant types......Page 207 Parameter passing......Page 209 Method calls......Page 211 Exit procedures......Page 212 The asm statement......Page 215 Instruction opcodes......Page 216 Assembler directives......Page 217 Operands......Page 221 Differences between Object Pascal and assembler expressions......Page 222 Constants......Page 223 Registers......Page 224 Symbols......Page 225 Expression classes......Page 226 Expression types......Page 228 Expression operators......Page 229 Assembler procedures and functions......Page 231 A: Object Pascal grammar......Page 233 Index......Page 239 Object Pascal Language Guide 1 Contents 3 Tables 7 1: Introduction 9 What’s in this manual? 9 Using Object Pascal 9 Typographical conventions 10 Other sources of information 10 Software registration and technical support 11 Part I: Basic language description 13 2: Overview 15 Program organization 15 Pascal source files 15 Other files used to build applications 16 Compiler-generated files 17 Example programs 17 A simple console application 17 A more complicated example 18 A native application 19 3: Programs and units 23 Program structure and syntax 23 The program heading 24 The program uses clause 24 The block 24 Unit structure and syntax 25 The unit heading 25 The interface section 26 The implementation section 26 The initialization section 26 The finalization section 27 Unit references and the uses clause 27 The syntax of a uses clause 28 Multiple and indirect unit references 28 Circular unit references 29 4: Syntactic elements 31 Fundamental syntactic elements 31 Special symbols 32 Identifiers 32 Qualified identifiers 32 Reserved words 33 Directives 33 Numerals 34 Labels 34 Character strings 34 Comments and compiler directives 35 Expressions 35 Operators 36 Arithmetic operators 36 Boolean operators 37 Logical (bitwise) operators 38 String operators 39 Pointer operators 39 Set operators 40 Relational operators 40 Class operators 41 The @ operator 42 Operator precedence rules 42 Function calls 43 Set constructors 43 Indexes 44 Typecasts 44 Value typecasts 44 Variable typecasts 45 Declarations and statements 46 Declarations 46 Statements 47 Simple statements 47 Assignment statements 47 Procedure and function calls 48 Goto statements 48 Structured statements 49 Compound statements 50 With statements 50 If statements 52 Case statements 53 Control loops 55 Repeat statements 55 While statements 55 For statements 56 Blocks and scope 57 Blocks 57 Scope 58 Naming conflicts 59 5: Data types, variables, and constants 61 About types 61 Simple types 62 Ordinal types 62 Integer types 63 Character types 65 Boolean types 65 Enumerated types 66 Subrange types 68 Real types 69 String types 70 Short strings 72 Long strings 72 WideString 73 About extended character sets 73 Working with null-terminated strings 73 Using pointers, arrays, and string constants 74 Mixing Pascal strings and null-terminated strings 75 Structured types 76 Sets 77 Arrays 78 Static arrays 78 Dynamic arrays 79 Array types and assignments 81 Records 81 Variant parts in records 82 File types 84 Pointers and pointer types 85 Overview of pointers 85 Pointer types 87 Character pointers 87 Other standard pointer types 87 Procedural types 88 Procedural types in statements and expressions 89 Variant types 90 Variant type conversions 91 Variants in expressions 93 Variant arrays 93 OleVariant 94 Type compatibility and identity 94 Type identity 94 Type compatibility 95 Assignment-compatibility 95 Declaring types 96 Variables 97 Declaring variables 97 Absolute addresses 98 Dynamic variables 98 Thread-local variables 98 Declared constants 99 True constants 99 Constant expressions 101 Resource strings 101 Typed constants 102 Array constants 103 Record constants 103 Procedural constants 104 Pointer constants 104 6: Procedures and functions 107 Declaring procedures and functions 107 Procedure declarations 108 Function declarations 109 Calling conventions 110 Forward and interface declarations 111 External declarations 112 Linking to object files 112 Importing functions from libraries 113 Overloading procedures and functions 114 Local declarations 116 Nested routines 116 Parameters 117 Parameter semantics 117 Value and variable parameters 118 Constant parameters 119 Out parameters 119 Untyped parameters 120 String parameters 121 Array parameters 121 Open array parameters 121 Variant open array parameters 122 Default parameters 123 Default parameters and overloaded routines 124 Default parameters in forward and interface declarations 125 Calling procedures and functions 125 Open array constructors 125 7: Classes and objects 127 Class types 128 Inheritance and scope 129 TObject and TClass 129 Compatibility of class types 129 Object types 130 Visibility of class members 130 Private, protected, and public members 131 Published members 131 Automated members 132 Forward declarations and mutually dependent classes 132 Fields 133 Methods 134 Method declarations and implementations 134 Inherited 135 Self 135 Method binding 136 Static methods 136 Virtual and dynamic methods 136 Abstract methods 138 Overloading methods 138 Constructors 139 Destructors 140 Message methods 141 Implementing message methods 142 Message dispatching 142 Properties 143 Property access 143 Array properties 145 Index specifiers 146 Storage specifiers 147 Property overrides and redeclarations 148 Class references 149 Class-reference types 149 Constructors and class references 150 Class operators 150 The is operator 150 The as operator 151 Class methods 151 Exceptions 152 When to use exceptions 152 Declaring exception types 153 Raising and handling exceptions 153 Try...except statements 154 Re-raising exceptions 156 Nested exceptions 157 Try...finally statements 157 Standard exception classes and routines 158 8: Standard routines and I/O 159 File input and output 159 Text files 161 Untyped files 162 Text-file device drivers 162 Device functions 163 The Open function 163 The InOut function 163 The Flush function 164 The Close function 164 Handling null-terminated strings 164 Wide-character strings 165 Other standard routines 165 Part II: Special topics 169 9: Libraries and packages 171 Calling dynamically loadable libraries 171 Static loading 171 Dynamic loading 172 Writing dynamically loadable libraries 173 The exports clause 175 Library initialization code 175 Global variables in a library 176 Libraries and system variables 176 Exceptions and runtime errors in libraries 177 Shared-memory manager (Windows only) 178 Packages 178 Package declarations and source files 179 Naming packages 180 The requires clause 180 The contains clause 180 Compiling packages 181 Generated files 181 Package-specific compiler directives 181 Package-specific command-line compiler switches 182 10: Object interfaces 183 Interface types 183 IInterface and inheritance 184 Interface identification 185 Calling conventions for interfaces 185 Interface properties 186 Forward declarations 186 Implementing interfaces 186 Method resolution clauses 187 Changing inherited implementations 188 Implementing interfaces by delegation 188 Delegating to an interface-type property 189 Delegating to a class-type property 189 Interface references 190 Interface assignment-compatibility 191 Interface typecasts 192 Interface querying 192 Automation objects (Windows only) 192 Dispatch interface types (Windows only) 192 Dispatch interface methods (Windows only) 193 Dispatch interface properties 193 Accessing Automation objects (Windows only) 193 Automation object method-call syntax 194 Dual interfaces (Windows only) 195 11: Memory management 197 The memory manager (Windows only) 197 Variables 198 Internal data formats 198 Integer types 199 Character types 199 Boolean types 199 Enumerated types 199 Real types 200 The Real48 type 200 The Single type 200 The Double type 201 The Extended type 201 The Comp type 201 The Currency type 201 Pointer types 201 Short string types 201 Long string types 202 Wide string types 202 Set types 203 Static array types 203 Dynamic array types 203 Record types 204 File types 204 Procedural types 206 Class types 206 Class reference types 207 Variant types 207 12: Program control 209 Parameters and function results 209 Parameter passing 209 Register saving conventions 211 Function results 211 Method calls 211 Constructors and destructors 212 Exit procedures 212 13: Inline assembler code 215 The asm statement 215 Register use 216 Assembler statement syntax 216 Labels 216 Instruction opcodes 216 RET instruction sizing 217 Automatic jump sizing 217 Assembler directives 217 Operands 221 Expressions 222 Differences between Object Pascal and assembler expressions 222 Expression elements 223 Constants 223 Registers 224 Symbols 225 Expression classes 226 Expression types 228 Expression operators 229 Assembler procedures and functions 231 A: Object Pascal grammar 233 Index 239
دانلود کتاب Borland - Object Pascal Language Guide