Difference between revisions of "Reserved words/ru"
Line 17: | Line 17: | ||
! ключевое слово !! описание | ! ключевое слово !! описание | ||
|- | |- | ||
− | | [[And|and]] || | + | | [[And/ru|and]] || логический оператор, требующий, чтобы оба операнда были равны true для того. чтобы результат был равен true |
|- | |- | ||
− | | [[Array|array]] || | + | | [[Array/ru|array]] || множество элементов с одинаковым именем |
|- | |- | ||
− | | [[Asm|asm]] || | + | | [[Asm/ru|asm]] || начало кода, написанного на языке ассемблера |
|- | |- | ||
− | | [[Begin|begin]] || | + | | [[Begin/ru|begin]] || начало [[Block/ru|блока]] кода |
|- | |- | ||
− | | [[Break|break]] || | + | | [[Break/ru|break]] || выход из условия [[Case/ru|case]] |
|- | |- | ||
− | | [[Case|case]] || | + | | [[Case/ru|case]] || выбирает определенный сегмент кода для выполнения в зависимости от значения |
|- | |- | ||
− | | [[Const|const]] || | + | | [[Const/ru|const]] || объявляет идентификатор с неизменяемым значением или переменную с инициализированным значением |
|- | |- | ||
− | | [[Constructor|constructor]] || | + | | [[Constructor/ru|constructor]] || процедура, используемая для создания объекта |
|- | |- | ||
− | | [[Continue|continue]] || | + | | [[Continue/ru|continue]] || пропускает инструкции в цикле '''for''' и возобновляет выполнение с начала цикла |
|- | |- | ||
− | | [[Destructor|destructor]] || | + | | [[Destructor/ru|destructor]] || процедура, используемая для "уничтожения" объекта |
|- | |- | ||
− | | [[Div|div]] || | + | | [[Div/ru|div]] || оператор целочисленного деления |
|- | |- | ||
− | | [[Do|do]] || | + | | [[Do/ru|do]] || используется для указания начала цикла |
|- | |- | ||
− | | [[Downto|downto]] || | + | | [[Downto/ru|downto]] || используется в цикле [[For/ru|for]] для указания декремента (уменьшения) переменной-счетчика |
|- | |- | ||
− | | [[Else|else]] || used in [[If|if]] statement to provide an execution path when the if test fails | + | | [[Else/ru|else]] || used in [[If|if]] statement to provide an execution path when the if test fails |
|- | |- | ||
| [[End|end]] || end of a block of code, a record or certain other constructs] | | [[End|end]] || end of a block of code, a record or certain other constructs] |
Revision as of 20:45, 15 January 2018
│
Deutsch (de) │
English (en) │
français (fr) │
polski (pl) │
русский (ru) │
中文(中国大陆) (zh_CN) │
Зарезервированные слова отдельных режимов компилятора объединены следующим образом:
- Режим Turbo Pascal: для использования доступны зарезервированные слова Turbo Pascal.
- Режим Delphi: для использования доступны зарезервированные слова Turbo Pascal и Object Pascal.
- Режим Free Pascal: для использования доступны зарезервированные слова Turbo Pascal и Object Pascal.
Зарезервированные слова в Turbo Pascal
Следующие зарезервированные слова встречаются в режиме Turbo Pascal:
ключевое слово | описание |
---|---|
and | логический оператор, требующий, чтобы оба операнда были равны true для того. чтобы результат был равен true |
array | множество элементов с одинаковым именем |
asm | начало кода, написанного на языке ассемблера |
begin | начало блока кода |
break | выход из условия case |
case | выбирает определенный сегмент кода для выполнения в зависимости от значения |
const | объявляет идентификатор с неизменяемым значением или переменную с инициализированным значением |
constructor | процедура, используемая для создания объекта |
continue | пропускает инструкции в цикле for и возобновляет выполнение с начала цикла |
destructor | процедура, используемая для "уничтожения" объекта |
div | оператор целочисленного деления |
do | используется для указания начала цикла |
downto | используется в цикле for для указания декремента (уменьшения) переменной-счетчика |
else | used in if statement to provide an execution path when the if test fails |
end | end of a block of code, a record or certain other constructs] |
false | boolean value indicating a test failed; opposite of true |
file | external data structure, typically stored on disc |
for | loop used to increment or decrement a control variable |
function | define start of a routine that returns a result value |
goto | used to exit a segment of code and jump to another point |
if | test a condition and perform a set of instructions based on the result |
implementation | define the internal routines in unit |
in | identifies elements in a collection |
inline | machine code inserted directly into a routine |
interface | public declarations of routines in a unit |
label | defines the target jump point for a goto |
mod | operator used to return the remainder of an integer division |
nil | pointer value indicating the pointer does not contain a value |
not | boolean operator that negates the result of a test |
object | defines an object construct |
of | defines the characteristics of a variable |
on | |
operator | defines a routine used to implement an operator |
or | boolean operator which allows either of two choices to be used |
packed | indicates the elements of an array are to use less space (this keyword is primarily for compatibility with older programs as packing of array elements is generally automatic) |
procedure | define start of a routine that does not return a result value |
program | defines start of an application. This keyword is usually optional. |
record | group a series of variables under a single name |
repeat | loop through a section of code through an until statement as long as the result of the test is true |
set | group a collection |
shl | operator to shift a value to the left; equivalent to multiplying by a power of 2 |
shr | operator to shift a value to the right; equivalent to dividing by a power of 2 |
string | declares a variable that contains multiple characters |
then | indicates start of code in an if test |
to | indicates a for variable is to be incremented |
true | boolean value indicating a test succeeded; opposite of false |
type | declares kinds of records or new classes of variables |
unit | separately compiled module |
until | indicates end test of a repeat statement |
uses | names units this program or unit refers to |
var | declare variables |
while | test a value and if true, loop through a section of code |
with | reference the internal variables within a record without having to refer to the record itself |
xor | boolean operator used to invert an or test |
Зарезервированные слова в 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
Зарезервированные слова в Free Pascal
Зарезервированные слова в режиме Free Pascal включают:
- зарезервированные слова режима Turbo Pascal
- зарезервированные слова режима Object Pascal
Модификаторы (директивы)
Ниже представлен список модификаторов. Модификаторы не являются строго зарезервированными словами, однако они используются так же, как зарезервированные слова.
Подробнее см. в руководстве по Free Pascal.
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
Неподдерживаемые модификаторы Turbo Pascal
The reason why these modifiers are not supported is that these modifiers deal with 16 bit code for DOS. 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.
More functionality
Apart from the language features provided by the reserved words/keywords mentioned above, there is a lot of functionality available for the programmer in the various libraries:
- RTL: Run-Time Library, available for all FPC and Lazarus programs
- FCL: Free Component Library: a core set of libraries available for Lazarus programs and usually for FPC (FPC can be compiled without it, but that only happens on purpose for low-memory embedded systems etc)
- FPC Packages: other packages provided by FPC
- Lazarus components: these are Lazarus components that can be dropped on a form and often based on FCL or FPC packages
- Lazarus utility functions: e.g. the fileutil unit.
Apart from the libraries provided by FPC and Lazarus, there are more libraries/components available:
- FPC user-supplied units: see the FPC wiki
- Lazarus CCR: components
- User-supplied code on the internet: see