| { |
Begin |
|
| } |
End |
|
| = |
:= |
Becomes |
| == |
= |
Equal |
| / |
/ |
Division (or sometimes div) |
| % |
Mod |
Modulo operation |
| ! |
Not |
|
| != |
<> |
Not equal |
| && |
And |
|
| || |
Or |
|
| ^ |
Xor |
|
| >> |
Shr |
bit shift right |
| << |
Shl |
bit shift left |
| ++ |
Inc |
|
| -- |
Dec |
|
| /* |
{ |
Comment start |
| /* |
(* |
Comment start |
| */ |
} |
Comment end |
| */ |
*) |
Comment end |
| // |
// |
End of line comment (only one line comment) |
| public static void main(String[] args) { } |
Program ProgramName; Begin End. |
Note the period after End |
| someType arrayVar[]; |
arrayVar: Array Of someType; |
|
| someType arrayVar[#]; |
arrayVar: Array[MINRANGE..MAXRANGE] Of someType; |
|
| null |
Nil |
|
| abstract |
Abstract |
|
| break |
Break |
|
| class TheClass { } |
TheClass = Class End; |
Delphi OOP |
| class TheClass { } |
TheClass = Object End; |
Turbo Pascal OOP |
| class TheClass<T> { } |
Generic TheClass = Class<T> End; |
Generics are classes only as of 2.2.2, likely to support more in the future |
| TheClass() |
Constructor CtorName |
Constructor name is by convention either Init or Create |
| continue |
Continue |
|
| do while |
Repeat Until Not |
|
| do while ! |
Repeat Until |
|
| enum TheEnum |
TheEnum = ( MINVALUE .. MAXVALUE ); |
|
| enum TheEnum = {MINVALUE, MAXVALUE} |
TheEnum = ( MINVALUE, MAXVALUE ); |
|
| TheEnum enumVar; |
enumVar := Set Of TheEnum; |
|
| extends |
SubClass = Class(BaseClass) |
class SubClass extends BaseClass --> SubClass(BaseClass) |
| final |
Const |
for constants, not uninheritables |
| for ++ |
For To Do |
|
| for -- |
For Downto Do |
|
| if() |
If Then |
|
| if() else |
If Then Else |
|
| implements |
SomeClass = Class(SomeInterface) |
|
| import |
Uses |
|
| instanceof |
Is |
|
| interface |
TheInterface = Interface |
|
| native |
StdCall |
For Windows |
| native |
CDecl |
For Unix |
| new primitive_type[#]; |
SetLength(ArrayVar, #); |
|
| new Class(); |
InstanceVar := TheClass.Create; |
|
| package pkgName; |
Unit unitName; Interface Implementation End. |
Note the period after End |
| private |
Private |
|
| protected |
Protected |
|
| public |
Public |
|
| return |
FunctionName := |
|
| return |
Result := |
ObjFPC or Delphi modes |
| static |
Static |
|
| static |
Class Function |
|
| static |
Class Procedure |
|
| super |
Inherited |
Parent constructor call |
| switch case break |
Case Of End |
|
| switch case break default |
Case Of Else End |
|
| synchronized |
|
|
| this |
Self |
|
| throw |
Raise |
|
| throws |
|
|
| transient |
|
|
| try { } catch |
Try except |
|
| try { } catch finally |
Try Finally |
|
| void |
Procedure |
|
| volatile |
|
|
| while |
While Do |
|