Difference between revisions of "Reserved words"

From Lazarus wiki
Jump to navigationJump to search
m
(Translated German version; demoted headers to comply with regular wiki formatting (AFAIU, no level 1 headers))
Line 1: Line 1:
 
{{Reserved words}}
 
{{Reserved words}}
 +
<br>
 +
__TOC__
 +
<br>
 +
The keywords of the individual [[Compiler Mode|compiler modes]] are summarized as follows:<br>
 +
* Turbo Pascal mode: the Turbo Pascal keywords are available for you to use<br>
 +
* Delphi mode: the Turbo Pascal and Object Pascal keywords are availabe for you to use<br>
 +
* Free Pascal mode: the Turbo Pascal and Object Pascal keywords are available for you to use<br>
 +
<br>
 +
Note: the terms keywords and reserved words are used interchangeably here ''is this correct?''
 +
''To do'': insert explanation/link to the online Free Pascal manual of what a keyword/reserved word is: e.g. can you name your variables "if" etc<br>
 +
''To do'': create pages for the keywords if they don't exist yet (e.g. translate from the German version) and link to the online Free Pascal manual section on that keyword in those pages.
 +
 +
==Reserved words in Turbo Pascal==
 +
The following keywords occur in Turbo Pascal mode:<br>
 +
[[And|and]]<br>
 +
[[Array|array]]<br>
 +
[[Asm|asm]]<br>
 +
[[Begin|begin]]<br>
 +
[[Break|break]]<br>
 +
[[Case|case]]<br>
 +
[[Const|const]]<br>
 +
[[Constructor|constructor]]<br>
 +
[[Continue|continue]]<br>
 +
[[Destructor|destructor]]<br>
 +
[[Div|div]]<br>
 +
[[Do|do]]<br>
 +
[[Downto|downto]]<br>
 +
[[Else|else]]<br>
 +
[[End|end]]<br>
 +
[[False|false]]<br>
 +
[[File|file]]<br>
 +
[[For|for]]<br>
 +
[[Function|function]]<br>
 +
[[Goto|goto]]<br>
 +
[[If|if]]<br>
 +
[[Implementation|implementation]]<br>
 +
[[In|in]]<br>
 +
[[Inline|inline]]<br>
 +
[[Interface|interface]]<br>
 +
[[Label|label]]<br>
 +
[[Mod|mod]]<br>
 +
[[Nil|nil]]<br>
 +
[[Not|not]]<br>
 +
[[Object|object]]<br>
 +
[[Of|of]]<br>
 +
[[On|on]]<br>
 +
[[Operator|operator]]<br>
 +
[[Or|or]]<br>
 +
[[Packed|packed]]<br>
 +
[[Procedure|procedure]]<br>
 +
[[Program|program]]<br>
 +
[[Record|record]]<br>
 +
[[Repeat|repeat]]<br>
 +
[[Set|set]]<br>
 +
[[Shl|shl]]<br>
 +
[[Shr|shr]]<br>
 +
[[String|string]]<br>
 +
[[Then|then]]<br>
 +
[[to|to]]<br>
 +
[[True|true]]<br>
 +
[[type|type]]<br>
 +
[[Unit|unit]]<br>
 +
[[Until|until]]<br>
 +
[[Uses|uses]]<br>
 +
[[Var|var]]<br>
 +
[[While|while]]<br>
 +
[[With|with]]<br>
 +
[[Xor|xor]]<br>
 +
<br>
 +
 +
==Reserved words in Object Pascal==
 +
Object Pascal extends the (Turbo) Pascal language with both support for dealing more easily with objects (object orientation) as well as other newer/more advanced concepts (threads, etc).<br>
 +
In addition to the reserved words in Turbo Pascal, the following reserved words are available in Delphi mode as well:<br>
 +
[[As|as]]<br>
 +
[[Class|class]]<br>
 +
[[Dispose|dispose]]<br>
 +
[[Except|except]]<br>
 +
[[Exit|exit]]<br>
 +
[[Exports|exports]]<br>
 +
[[Finalization|finalization]]<br>
 +
[[Finally|finally]]<br>
 +
[[Inherited|inherited]]<br>
 +
[[Initialization|initialization]]<br>
 +
[[Is|is]]<br>
 +
[[Library|library]]<br>
 +
[[New|new]]<br>
 +
[[On|on]]<br>
 +
[[Out|out]]<br>
 +
[[Property|property]]<br>
 +
[[Raise|raise]]<br>
 +
[[Self|self]]<br>
 +
[[Threadvar|threadvar]]<br>
 +
[[Try|try]]<br>
 +
<br>
  
The following are [[Reserved word|reserved words]] and may not be used as [[Variable|variables]], [[Function|functions]],[[Procedure|procedures]] methods, or object [[Identifier|identifiers]].
+
==Reserved words in Free Pascal==
 +
The reserved words in Free Pascal mode include:
 +
* Turbo Pascal mode reserved words
 +
* Object Pascal mode reserved words<br>
 +
<br>
 +
 
 +
==Modifiers (directives)==
 +
The list below is a list of modifiers<br>
 +
Modifiers are not strictly reserved words; however they are used in the same way as reserved words.<br>
 +
See the Free Pascal manual for details.<br>
 +
[[Absolute|absolute]]<br>
 +
[[Abstract|abstract]]<br>
 +
[[Alias|alias]]<br>
 +
[[Assembler|assembler]]<br>
 +
[[Cdecl|cdecl]]<br>
 +
[[Cppdecl|cppdecl]]<br>
 +
[[Default|default]]<br>
 +
[[Export|export]]<br>
 +
[[External|external]]<br>
 +
[[Forward|forward]]<br>
 +
[[Index|index]]<br>
 +
[[Local|local]]<br>
 +
[[Name|name]]<br>
 +
[[Nostackframe|nostackframe]]<br>
 +
[[oldfpccall|oldfpccall]]<br>
 +
[[Override|override]]<br>
 +
[[pascal|pascal]]<br>
 +
[[Private|private]]<br>
 +
[[Protected|protected]]<br>
 +
[[Public|public]]<br>
 +
[[Published|published]]<br>
 +
[[Read|read]]<br>
 +
[[Register|register]]<br>
 +
[[Reintroduce|reintroduce]]<br>
 +
[[Safecall|safecall]]<br>
 +
[[Softfloat|softfloat]]<br>
 +
[[Stdcall|stdcall]]<br>
 +
[[Virtual|virtual]]<br>
 +
[[Write|write]]<br>
 +
<br>
  
* [[Absolute]]
+
==Unsupported Turbo Pascal modifiers==
* [[Abstract]]
+
The reason why these modifiers are not support is that these modifiers deal with 16 bit code<br>
* [[And]]
+
In other words, these modifiers have special meaning for 16 bit programming under DOS and Windows 3.x<br>
* [[Array]]
+
As Free Pascal does not support 16 bit code (only 32 and 64 bit), these modifiers are irrelevant in Free Pascal code<br>
* [[As]]
+
[[Far|far]]<br>
* [[Begin]]
+
[[Near|near]]<br>
* [[Break]]
 
* [[Case]]
 
* [[Class]]
 
* [[Const]] 
 
* [[Constructor]]
 
* [[Continue]] 
 
* [[Destructor]]
 
* [[Dispose]]
 
* [[Div]]
 
* [[Do]]
 
* [[Downto]] 
 
* [[Else]]
 
* [[End]]
 
* [[Except]]
 
* [[Exit]]
 
* [[Exports]]
 
* [[False]]
 
* [[File]]
 
* [[Finalization]] 
 
* [[Finally]]
 
* [[For]]
 
* [[Function]]
 
* [[goto|Goto]]
 
* [[If]]
 
* [[Implementation]]
 
* [[In]]
 
* [[Inherited]]
 
* [[Initialization]]
 
* [[Inline]] 
 
* [[Interface]]
 
* [[Is]]
 
* [[label|Label]]
 
* [[Library]]
 
* [[Mod]]
 
* [[New]]
 
* [[Nil]]
 
* [[Not]]
 
* [[Object]]
 
* [[Of]]
 
* [[On]]
 
* [[Operator]] 
 
* [[Or]]
 
* [[Out]]
 
* [[Packed]]
 
* [[Procedure]]
 
* [[Program]]
 
* [[Property]]
 
* [[Raise]]
 
* [[Record]]
 
* [[Repeat]]
 
* [[Self]]
 
* [[Set]]
 
* [[Shl]]
 
* [[Shr]]
 
* [[String]]
 
* [[Then]]
 
* [[Threadvar]]
 
* [[To]]
 
* [[True]]
 
* [[Try]]
 
* [[Type]]
 
* [[Unit]]
 
* [[Until]]
 
* [[Uses]]
 
* [[Var]]
 
* [[Virtual]]
 
* [[While]]
 
* [[With]]
 
* [[Xor]]
 
 
<br>
 
<br>
 
<br>
 
<br>
  
[[category:Pascal]]
+
[[category:Pascal]]{{AutoCategory}}

Revision as of 13:14, 1 December 2012

Deutsch (de) English (en) français (fr) polski (pl) русский (ru) 中文(中国大陆)‎ (zh_CN)


The keywords of the individual compiler modes are summarized as follows:

  • Turbo Pascal mode: the Turbo Pascal keywords are available for you to use
  • Delphi mode: the Turbo Pascal and Object Pascal keywords are availabe for you to use
  • Free Pascal mode: the Turbo Pascal and Object Pascal keywords are available for you to use


Note: the terms keywords and reserved words are used interchangeably here is this correct? To do: insert explanation/link to the online Free Pascal manual of what a keyword/reserved word is: e.g. can you name your variables "if" etc
To do: create pages for the keywords if they don't exist yet (e.g. translate from the German version) and link to the online Free Pascal manual section on that keyword in those pages.

Reserved words in Turbo Pascal

The following keywords occur in Turbo Pascal mode:
and
array
asm
begin
break
case
const
constructor
continue
destructor
div
do
downto
else
end
false
file
for
function
goto
if
implementation
in
inline
interface
label
mod
nil
not
object
of
on
operator
or
packed
procedure
program
record
repeat
set
shl
shr
string
then
to
true
type
unit
until
uses
var
while
with
xor

Reserved words in Object Pascal

Object Pascal extends the (Turbo) Pascal language with both support for dealing more easily with objects (object orientation) as well as other newer/more advanced concepts (threads, etc).
In addition to the reserved words in Turbo Pascal, the following reserved words are available in Delphi mode as well:
as
class
dispose
except
exit
exports
finalization
finally
inherited
initialization
is
library
new
on
out
property
raise
self
threadvar
try

Reserved words in Free Pascal

The reserved words in Free Pascal mode include:

  • Turbo Pascal mode reserved words
  • Object Pascal mode reserved words


Modifiers (directives)

The list below is a list of modifiers
Modifiers are not strictly reserved words; however they are used in the same way as reserved words.
See the Free Pascal manual for details.
absolute
abstract
alias
assembler
cdecl
cppdecl
default
export
external
forward
index
local
name
nostackframe
oldfpccall
override
pascal
private
protected
public
published
read
register
reintroduce
safecall
softfloat
stdcall
virtual
write

Unsupported Turbo Pascal modifiers

The reason why these modifiers are not support is that these modifiers deal with 16 bit code
In other words, these modifiers have special meaning for 16 bit programming under DOS and Windows 3.x
As Free Pascal does not support 16 bit code (only 32 and 64 bit), these modifiers are irrelevant in Free Pascal code
far
near