Delphi's Basic Pascal Syntax (Chapter I. PASCAL introduction)

Source: Internet
Author: User

The first chapter, Pascal introduction
First, the basic grammatical unit of Pascal

1. Basic symbols
A--z;a--z;0--9;+,-,*,/,=,<>,<=,>=,<,>, (,), [,],{,},:=,,,;,.,:,.., ', ^
Note: Pascal language must not use any other symbols other than the basic symbols set out above.

2. Reserved words
And,array,begin,case,const,div,do,diwnto,else,end,file,for,funtion,goto,if,label,mod,nil,of,or,packed, Procedure,program,record,repeat,set,then,to,type,until,var,while,with.
Note: The file name cannot be the same as the reserved word.

3. Identifiers
An alphanumeric string that starts with a letter and is less than or equal to 8 in length.
Standard identifiers (39 total):
Standard constants:
False,true,maxint
Standard type:
Integer,real,char,boolean,text
Standard file:
Input,output
Standard functions:
ABS,ARCTAN,CHR,COS,EOF,EOLN,EXP,LN,ODD,ORD,ORED,ROUND,SIN,SQR,
Sqrt,succ,trunc
Standard process:
Get,new,pack,page,put,read,readln,reset,rewrite,unpack,write, Writeln

II. Structure of the program
1, consists of three parts: the first part of the program, the Description section, the statement part.
Program name (input,output);
{......} Explain
CONST
pi=3.14159;
Var
R,l,s:real;
BEGIN
Write (' Input r: ');
Read (R);
L:=2*pi*r;
Write (' l= ', L, ' s= ', s);
END;
2, a large number of use of punctuation, reserved words without punctuation (end except).

Delphi's Basic Pascal Syntax (Chapter I. PASCAL introduction)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.