Differences between Smart Pascal and Free Pascal (Lazarus)
We have positioned towards the beginning of the table a few syntax differences that beginners are likely to encounter. More experienced programmers will be interested in the more general fundamental differences that follow.
|Language feature||Free Pascal/Lazarus||Smart Pascal|
|Array constants||Square or round brackets|
|Type inference||none||var MyInt = 15;|
|In-line variable declarations||not possible||for var i := 1 to 3 do
|No char variable type. Use a string to represent a single character.|
Widely used, but no inbuilt routines
|Powerful, with inbuilt routines such as Push (to add an element to the end), Pop (to remove the last element), Clear, Copy, Delete, IndexOf, Swap and Reverse|
|Random||MyRandomInt := Random(10);||MyRandomInt := RandomInt(10);|
|writeln||Takes multiple arguments of different types e.g.
||Takes one string e.g.
|Field widths and display of reals||Writeln(MyReal : 6 : 2)||not possible|
|Input key codes||ASCII||
asm ADD Int1, 5 SUB Int2, 30 end;
asm document.location.href="http://www.pp4s.co.uk/"; end;
|Sets||Lots of functionality||Limited functionality|
|Pointers||See use of pointers in linked lists||No pointers|
|File handling||Easy to write and read local files||Very different: see Storing and Loading Data|
|Graphics||Several approaches including Canvas, Graph or WinGraph and SDL||Very different, using HTML5 Canvas|
|List of Objects||TList||TObjectList|