I.T. Discussion Community!
-Collapse +Expand
Delphi
Search Delphi Group:

Advanced
-Collapse +Expand Delphi To/From
To/FromCODEGuides
-Collapse +Expand Delphi Store
PRESTWOODSTORE
   ► KBProgrammingDelphi for W...Language Basics   Print This     

Delphi KB: Language Basics Topic



25+ Articles Found in the Language Basics Topic 

  KB Article    

Mike Prestwood
1. 20 Minute Delphi Primer: Displaying Things

This primer is intended for those just getting started in Delphi and focuses on displaying things.

9 years ago, and updated 8 years ago
(1 Comments , last by Alaina.A )

KB Post
Nothing New Since Your Last Visit
5945
Hits

Pascal and Delphi Coding

Mike Prestwood
2. A 10 Minute Delphi Console App Quick Start

Create a classic "Hello, World" Windows native code Console App using Delphi. This tutorial is based on Borland Developer Suite 2006 but you can use any version of Delphi you wish. In this tutorial, you will create a classic "Hello, World!" windows console application. A console application is a type of Windows application that has FULL access to the Win32 API, but it's GUI is limited to a DOS-like text window. When Windows starts a console application, it creates a text-mode console window where the program can display text and the user can interact with the program via the keyboard.

9 years ago
(1 Comments , last by Austin.M )

Article
Nothing New Since Your Last Visit
199533
Hits

Pascal and Delphi Coding

Mike Prestwood
3. A 10 Minute Delphi for Win32 Quick Start Create a classic "Hello, World" Windows native code application using Delphi. This tutorial is based on Borland Developer Suite 2006 but you can use any version of Delphi you wish.
9 years ago, and updated 9 years ago

Article
Nothing New Since Your Last Visit
8926
Hits

Pascal and Delphi Coding

Mike Prestwood
4. Camel versus Pascal Casing What is the difference between Camel Casing and Pascal Casing?
9 years ago, and updated 9 years ago
(1 Comments , last by mprestwood )

FAQ
Nothing New Since Your Last Visit
15948
Hits

Pascal and Delphi Coding

Mike Prestwood
5. Delphi Assignment (:=)

Delphi uses := for it's assignment operator.

9 years ago, and updated 9 years ago

Code
Nothing New Since Your Last Visit
5805
Hits

Pascal and Delphi Coding

Mike Prestwood
6. Delphi Case Sensitivity (No)

Object Pascal is generally not case sensitive.

9 years ago, and updated 8 years ago
(3 Comments , last by Bailey.S )

Code

KB Post
Nothing New Since Your Last Visit  
15236
Hits

Pascal and Delphi Coding

Mike Prestwood
7. Delphi Code Blocks (begin..end)

Object Pascal requires the semi-colon after the "declaration" part.

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit
6572
Hits

Pascal and Delphi Coding

Mike Prestwood
8. Delphi Comments (// or { ... } or (* ... *))

Delphi uses // for a single line comment and both {} and (**) for multiple line comments. Although you can nest different types of multiple line comments, it is recommended that you don't. A special comment. Delphi compiler directives are in the form of {$DIRECTIVE}. Of interest for comments is using the $IFDEF compiler directive to remark out code.

9 years ago, and updated 9 years ago
(5 Comments , last by Uwais.Q )

Code

Article
Nothing New Since Your Last Visit  
31360
Hits

Pascal and Delphi Coding

Mike Prestwood
9. Delphi Constants (Const kPI: Double=3.1459;)

In Delphi, you define constants similar to how you define variables but use the Const keyword instead of the Var keyword. Declare global constants in a unit's interface section and unit constants (scope limited to unit) in the implementation section. Declare local constants above the begin..end block.

9 years ago, and updated 8 years ago

Code

KB Post
Nothing New Since Your Last Visit  
11540
Hits

Pascal and Delphi Coding

Mike Prestwood
10. Delphi Development Tools

Languages Focus: Development Tools

Primary development tool(s) used to develop and debug code.

Delphi Development Tools

CodeGear Delphi is the primary tool of choice for most developers but other Object Pascal language development tools do exist and some are quite good.

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit
5732
Hits

Pascal and Delphi Coding

Mike Prestwood
11. Delphi End of Statement (;)

Languages Focus: End of Statement

In coding languages, common End of statement specifiers include a semicolon and return (others exist too). Also of concern when studying a language is can you put two statements on a single code line and can you break a single statement into two or more code lines.

Delphi End of Statement

Object Pascal uses a semicolon ";" as an end of statement specifier and you can put multiple statements on a single line of code and put a single statement on two or more code lines if you wish.

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit  
5982
Hits

Pascal and Delphi Coding

Mike Prestwood
12. Delphi File Extensions

Common source code file extensions include:

  • .BDSPROJ - Project, Borland Developer Studio project file holds compiler options, etc. This is the file you open.
  • .DCU - Delphi Compiled Unit file.
  • .DFM - Delphi Win32 form file (a text resource file).
  • .DPR - Delphi project file. Primary project "source" file.
  • .PAS - Delphi unit source file.
9 years ago, and updated 8 years ago

Code

KB Post
Nothing New Since Your Last Visit
7181
Hits

Pascal and Delphi Coding

Mike Prestwood
13. Delphi If Statement (If..Else If..Else)

Notice in the more complete example that the semicolon for the begin..end block after end is not included. That tells the compiler something else is coming (the statement is not finished). Also note the semicolon is missing right before the final "else" statement.

Note: The following example uses floating point literals. In Delphi, to specify a fractional floating point literal between 1 and -1, you preceed the decimal with a 0; otherwise, you will get a compiler error (i.e. .1 + .1 does not work).

9 years ago, and updated 8 years ago
(6 Comments , last by Uwais.Q )

Code
Nothing New Since Your Last Visit
21687
Hits

Pascal and Delphi Coding

Mike Prestwood
14. Delphi Literals (apostrophe)

Literals are single quoted (the apostrophe) as in 'Prestwood'. If you need to embed an apostrophe use two apostrophies in a row.

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit  
12745
Hits

Pascal and Delphi Coding

Mike Prestwood
15. Delphi Logical Operators

Delphi logical operators:

and and, as in this and that
or or, as in this or that
not Not, as in Not This
xor either or, as in this or that but not both

8 years ago
(1 Comments , last by james.l2 )

Code
Nothing New Since Your Last Visit  
12199
Hits

Pascal and Delphi Coding

Mike Prestwood
16. Delphi Module A unit. A unit is defined in its own source file (a .PAS file) that contains types (including classes), constants, variables, and routines (functions and procedures). Each unit begins with unit UnitName; where UnitName must match the filename (minus the .PAS extension). The .PAS unit files are compiled into Delphi Compiled Units with a .DCU extension. A Delphi program is constructed from units. Specifically, the .DCU files are linked into your application. The Delphi compiler is very fast because it only recompiles units that have changed. You can force Delphi to recompile all units with a build all.
9 years ago

Definition
Nothing New Since Your Last Visit
7036
Hits

Pascal and Delphi Coding

Mike Prestwood
17. Delphi Overview and History

CodeGear Delphi Helmet IconLanguage Overview: Delphi programming language is a type-safe language consisting of hybrid traditional Pascal and OOP features. You code either in a traditional approach using functions, procedures, and global data, or you code using an OOP approach, or a mixture of both.

Target Platforms: Delphi for Win32 is most suitable for creating native code Win32 applications that run on Microsoft Windows.

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit
5240
Hits

Pascal and Delphi Coding

Mike Prestwood
18. Delphi Parameters (var, const)

Object Pascal allows parameters of the same type to be listed together, separated by commas, and followed with a single data type (more params of different data types can follow, after a semi-colon). The default for parameters is by value. For by reference, add var in front of the parameter. Object Pascal also offers constant parameters where you add const in front of the parameter. A constant parameter is like a local constant or read-only parameter the compiler can optimize. You cannot assign a value to a constant parameter, nor can you pass one as a var parameter to another routine.

9 years ago, and updated 8 years ago

Code

Article
Nothing New Since Your Last Visit  
14995
Hits

Pascal and Delphi Coding

Mike Prestwood
19. Delphi Report Tools Overview

Rave Reports comes closest to a Delphi standard now but historically there has been no real standard in Delphi development. Do-it-yourself developers sometimes like to use TPrinter for very simple reports. ReportSmith was bundled with the first few versions of Delphi.

Delphi has offered many embedded VCL component report options. Quick Reports has been a part of Delphi since Delphi 2.0 and has been the default report writer for many Delphi developers. Ace Reporter, ReportBuilder and Rave Reports are also very popular. During the time of Kylix, FastReports was popular because of it's cross-platform nature.

9 years ago, and updated 8 years ago
(3 Comments , last by Uwais.Q )

Code

KB Post
Nothing New Since Your Last Visit
24934
Hits

Pascal and Delphi Coding

Mike Prestwood
20. Delphi String Concatenation (+)

Use the + operator to concatenate two strings. Use IntToStr to convert an integer to a string and FloatToStr to convert a floating point number to a string.

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit
5598
Hits

Pascal and Delphi Coding

Mike Prestwood
21. Delphi Unary Operators

An operation with only one operand (a single input). In Object Pascal, a unary operator always precedes its operand (for example, -B), except for ^, which follows its operand (for example, P^). The Delphi unary operators are +, -, and ^ (pointer).

The TYPE operator is also a unary operator and is´┐Żevaluated at compile time. The TYPE operator returns the size in bytes of the operand,

9 years ago, and updated 8 years ago

Code
Nothing New Since Your Last Visit
11510
Hits

Pascal and Delphi Coding

Mike Prestwood
22. Delphi Variables (var x: Integer = 0;)

Declare global variables in the interface section of a unit, variables declared within the implementation section (but not within a method) have a scope limited to the unit. You declare local variables in a var block outside (above) your begin..end code block. You cannot declare variables in-line (inside begin..end). You can initialize global and unit variables but you cannot initialize local variables. Delphi offers many variable types. Some common variable types include String, WideString, PCharInteger, Boolean, Single, Double, Pointer, and Variant.

9 years ago, and updated 8 years ago

Code

KB Post
Nothing New Since Your Last Visit  
18913
Hits

Pascal and Delphi Coding

Mike Prestwood
23. Native Code versus Managed .Net Code

What are the benefits of Win32/64 native code such as in Delphi over .Net?

9 years ago, and updated 7 years ago
(3 Comments , last by mtiede )

FAQ
Nothing New Since Your Last Visit
7827
Hits

Pascal and Delphi Coding

Daniel Kram
24. One Recommended way of writing IF/End IF statements

Format the IF/Endif for easy reading. I have found this to be easy to read and follow:

if (         (something = somethingelse)
      and (x = y)
      and (z = a)
   ) then
begin
..
end;

To indent the structure and line up the parenthesis makes it, I feel, much easier to read.

9 years ago, and updated 7 years ago
(3 Comments , last by mtiede )

Tip
Nothing New Since Your Last Visit
8101
Hits

Pascal and Delphi Coding

Wes Peterson
25. Simple Habits Save Lots of Pain We developers sometimes get "on a roll." We know exactly what we need to do, and the code just flies off our fingertips. Later, though, we find ourselves in trouble...
10 years ago, and updated 10 years ago

KB Post
Nothing New Since Your Last Visit
4667
Hits

Pascal and Delphi Coding

Icon Legend:
Recent or not:
- Recent activity (within last two weeks).
- No activity last two weeks.
 Since your last logged visit:
- New to you or updated since your last visit (sign in now to activate).
- NOT new to you since your last visit (sign in now to activate).

New Pascal and Delphi Coding Knowledge Base Post...

Share your knowledge with the WORLD! In addition to adding comments to existing posts, you can post knowledge you've acquired. We welcome full articles (intro with screen shots), general posts (shorter), and tidbits (tips, FAQs, definitions, etc.).

Post New...

Tidbit Post: Short Flashcard FAQ Definition Quick Tip Code Snippet
Longer Post: Full Article General Post File Link Error News
Other: Blog Topic
Or, if YOU have a question...
  Pascal and Delphi Coding Message Board
-
   Contact Us!
 
PrestwoodBoards.com was developed and is maintainted by me. Do you have a question or suggestion? Do you see a problem? Contact me now. My goal is to build an ad-free and spam-free source of I.T. information with many contributers (ok to promote your website/company in your bio). Yes, my company Prestwood IT Solutions is mentioned in my bio which shows with every post, but you can contribute and promote your pet project too!

1,843 People Online Now!!  
Sign In to see who's online now!  Not a member? Join now. It's free!
Show more stats...


©1995-2017 PrestwoodBoards  [Security & Privacy]
Professional IT Services: Coding | Websites | Computer Tech