Reference

Delphi Overview

Delphi Overview

Program Organization 349

Example Programs 351

Programs and Units

Programs and Units

Program Structure and Syntax 356

Unit Structure and Syntax 358

Unit References and the Uses Clause 360

Using Namespaces (.NET Only)

Declaring Namespaces 365

Searching Namespaces 366

Using Namespaces 368

Syntactic Elements

Syntactic Elements

The Delphi Character Set 371

The Delphi Character Set and Basic Syntax 371

Comments and Compiler Directives 376

Declarations and Statements

Declarations 377

Statements 379

Simple Statements 379

Structured Statements 381

Blocks and Scope 390

Expressions

Expressions 393

Function Calls 401

Set Constructors 402

Indexes 402

Typecasts 402

Data Types, Variables, and Constants

Data Types, Variables, and Constants

About Types 407

Simple Types

Ordinal Types 409

Real Types 416

String Types

About String Types 419

Short Strings 420

Long Strings 421

WideString 421

Working with null-Terminated Strings 422

Structured Types

Sets 426

Arrays 427

Records 432

File Types 435

Pointer Types

Overview of pointers 437

Pointer Types 438

Procedural Types

About Procedural Types 441

Procedural Types in Statements and Expressions 442

Variant Types

Variants Overview 445

Variant Type Conversions 445

Variants in Expressions 447

Variant Arrays 447

OleVariant 448

Type Compatibility

Type Identity 449

Type Compatibility 450

Assignment Compatibility 450

Declaring Types

Type Declaration Syntax 452

Variables

Declaring Variables 454

Declared Constants

True Constants 457

Typed Constants 459

Procedures and Functions

Procedures and Functions

About Procedures and Functions 464

Declaring Procedures and Functions 464

Calling Conventions 467

Forward and Interface Declarations 468

External Declarations 469

Overloading Procedures and Functions 471

Local Declarations 473

Parameters

About Parameters 475

Parameter Semantics 475

String Parameters 479

Array Parameters 480

Default Parameters 483

Calling Procedures and Functions

Program Control and Parameters 485

Open Array Constructors 485

Classes and Objects

Classes and Objects

Class Types 488

Inheritance and Scope 490

Visibility of Class Members 491

Forward Declarations and Mutually Dependent Classes 494

Fields

About Fields 496

Class Fields (.NET) 497

Methods

About Methods 498

Method Binding 500

Overloading Methods 504

Constructors 505

The Class Constructor (.NET) 506

Destructors 507

Message Methods 508

Properties

About Properties 510

Property Access 510

Array Properties 512

Index Specifiers 514

Storage Specifiers 515

Property Overrides and Redeclarations 515

Class Properties (.NET) 517

Class References

Class-Reference Types 519

Class Operators 520

Class Methods 521

Exceptions

About Exceptions 523

When To Use Exceptions 523

Declaring Exception Types 524

Raising and Handling Exceptions 525

Standard Exception Classes and Routines 530

Standard Routines and I/O

Standard Routines and I/O

File Input and Output 532

Text File Device Drivers 535

Handling null-Terminated Strings 537

Other Standard Routines 538

Libraries and Packages

Libraries and Packages

Calling Dynamically Loadable Libraries 543

Static Loading 543

Dynamic Loading 543

Writing Dynamically Loadable Libraries

Using Export Clause in Libraries 545

Library Initialization Code 547

Global Variables in a Library 548

Libraries and System Variables 548

Exceptions and Runtime Errors in Libraries 549

Shared-Memory Manager (Win32 Only) 549

Packages

Understanding Packages 550

Package Declarations and Source Files 550

Compiling Packages 552

Object Interfaces

Object Interfaces

Interface Types 556

IInterface and Inheritance 557

Interface Identification 557

Calling Conventions for Interfaces 558

Interface Properties 559

Forward Declarations 559

Implementing Interfaces

Class Declarations 560

Method Resolution Clause 561

Changing Inherited Implementations 562

Implementing Interfaces by Delegation 562

Interface References

Implementing Interface References 565

Interface Assignment Compatibility 566

Interface Typecasts 566

Interface Querying 567

Automation Objects

Dispatch Interface Types 568

Dispatch interface methods 568

Dispatch interface properties 569

Accessing Automation Objects 569

Automation Object Method-Call Syntax 569

Dual Interfaces 570

Memory Management

Memory Management

The Memory Manager (Win32 Only) 572

Variables 572

Internal Data Formats

Integer Types 574

Character Types 574

Boolean Types 574

Enumerated Types 574

Real Types 574

Pointer Types 576

Short String Types 577

Long String Types 577

Wide String Types 577

Set Types 578

Static Array Types 578

Dynamic Array Types 578

Record Types 579

File Types 580

Procedural Types 582

Class Types 582

Class Reference Types 583

Variant Types 583

Memory Management Issues on the .NET Platform

Constructors 505

Finalization 584

The Dispose Pattern 585

Unit Initialization and Finalization 586

Unit Initialization Considerations for Assemblies and Dynamically Linked Packages 587

Program Control

Program Control

Passing Parameters 590

Handling Function Results 592

Handling Method Calls 592

Understanding Exit Procedures 593

Inline Assembly Code (Win32 Only)

Inline Assembly Code

Using the asm Statement 596

Using Registers 596

Assembler Syntax

Assembler Statement Syntax 597

Labels 597

Instruction Opcodes 598

Assembly Directives 599

Operands 603

Expressions

Differences between Delphi and Assembler Expressions 605

Expression Elements 606

Expression Classes 610

Expression Types 612

Expression Operators 613

Assembly Procedures and Functions

Compiler Optimizations 616

Function Results 617

.NET Topics

Using .NET Custom Attributes

Declaring a Custom Attribute Class 619

Using Custom Attributes 620

Using the DllImport Custom Attribute 621

Custom Attributes and Interfaces 621

Command-Line Switches

IDE command-line switches and options

IDE command-line switches 623

General options 623

Debugger options 624

Project options 624

Concepts

Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook


Post a comment