
| Type | Delphi/Pascal | perl | C | Basic | bash | Java | Notes |
|---|---|---|---|---|---|---|---|
| Statement terminators |
; | ; | ; | New line | ; | 1 | |
| Assignment | := | = | = | = | |||
| Block Comment |
{ comment }
(* comment*) |
/* comment */ | /* comment */ | ||||
| Line comment | //comment | # | //comment | ||||
1 - Strictly speaking, Delphi doesn’t have Statement terminators; it has statement separators. That’s a distinction that, if K&R had known about when writing the C language we wouldn't have ugly things like:
if (expression) a = b; else c = d;
That first “;” is because C uses terminators.
| Type | Delphi/Pascal | perl | C | Basic | bash | Java |
|---|---|---|---|---|---|---|
| Program block | begin statement 1; statement 2 end |
{ statement 1; statement 2; } |
{ statement 1; statement 2; } |
|||
| if then else | if expression then statement else statement; |
if (expression) then statement else statement |
||||
| For loops | for I := 1 to 10 do statement; | for (int I=1; I<=10; I++) statement; | for (int I=1; I<=10; I++) statement; | |||
| Reverse For loop | for I := 10 downto 1 do | for (int I=10; I>=1; I--) statement; | for (int I=10; I>=1; I--) statement; | |||
| Type | Delphi/Pascal | perl | C | Basic | bash | Java |
|---|---|---|---|---|---|---|
| list separator | , | |||||
| Auto Inc | ++ | |||||
| Auto Dec | -- | |||||
| Exponentiation | ** | |||||
| Strings | ||||||
| Type | Delphi/Pascal | perl | C | Basic | bash | Java |
|---|---|---|---|---|---|---|
| list separator | , | |||||
| Auto Inc | ++ | |||||
| Auto Dec | -- | |||||
| Exponentiation | ** | |||||
| Type | Delphi/Pascal | C | perl | Basic | bash | Java |
|---|---|---|---|---|---|---|
| Greater than | > | > | > | > | ||
| Greater than or = |
>= | >= | >= | >= | ||
| Less than | < | < | < | < | ||
| Less than or = |
<= | <= | <= | <= | ||
| Equal to | = | == | == | = | == | |
| Not equal | <> | != | <> | |||
| Compare /w signed results |
<=> |
| Type | Delphi/Pascal | C | perl | Basic | bash | Java |
|---|---|---|---|---|---|---|
| Concatenate | + | . | + & |
|||
| list separator | , | |||||
| Type | Delphi/Pascal | C | perl | Basic | bash | Java |
|---|---|---|---|---|---|---|
| not | ! | |||||
| negation | - | |||||
| negation bit-wise |
~ | |||||
| Reference | \ | |||||
| and | and | & | and | & | ||
| or | or | | | | | | | ||
| xor | ^ | ^ | ||||
| mod | mod | % | % | |||
| conditional and | && | && | ||||
| Conditional or | || | || |
Need to add:
Mention of structures, arrays, lists, sets. (Delphi has structures (records),
arrays, sets, but I don’t think it has lists). C has structures (structs) and
arrays Objects.
![]() |
3209 W.9th street Lawrence, KS 66049 USA |
Ph |
(785) 841 3089 (785) 841 0434 inform@xtronics.com http://xtronics.com |
Bookmark this page
|
| Transtronics Home Page See our line of industrial control electronics |
PLC's Index | PC test equipment and EPROM programmer | Process Control Panel meters |
Current sensors | Resource library handbooks, primers and spec sheets |
Corporate information and
privacy statement
(C) Copyright 1994-2006, Transtronics, Inc. All rights reserved
Transtronics® is a registered trademark of Transtronics, Inc.