DMarlon Studio

Advanced Pascal course

For those who know the basics: the techniques used in real projects. In DMarlon Studio, Pascal powers desktop apps with Lazarus (like the offline Odoo demo) and the console.

Start
  1. 1Classes and objectsDeclare Object Pascal classes with fields, methods, a constructor and a destructor, and learn to release objects with Free in Free Pascal.Lesson 1
  2. 2Visibility and propertiesProtect your class data with private and public, and expose it through properties that validate on write and compute on read in Object Pascal.Lesson 2
  3. 3Inheritance and inheritedBuild child classes in Object Pascal that inherit fields and methods, and call the parent constructor with inherited in Free Pascal.Lesson 3
  4. 4Virtual methods and polymorphismUse virtual and override in Object Pascal so each class answers the same call in its own way: polymorphism with shipping rates.Lesson 4
  5. 5Abstract classesDeclare abstract methods in Object Pascal to define a common outline that each child class fills in, with payment methods and their fees.Lesson 5
  6. 6InterfacesDefine Object Pascal interfaces, implement them in unrelated classes and let reference counting free the objects for you.Lesson 6
  7. 7ExceptionsRaise and catch exceptions in Object Pascal with raise and try/except, and create your own exception classes for your application's errors.Lesson 7
  8. 8Try/finally and cleanupMake sure your objects are released even when errors happen with try/finally in Object Pascal, the pattern that prevents memory leaks.Lesson 8
  9. 9Pointers, New and DisposeWork with pointers in Pascal: addresses with @, access with ^, and dynamic memory allocated with New and released with Dispose.Lesson 9
  10. 10A linked listBuild a linked list in Pascal with records and pointers: create nodes, insert in the middle without moving anything and free all the memory.Lesson 10
  11. 11Generics with fglUse the generic lists and maps from Free Pascal's fgl unit, TFPGList and TFPGMap, to store orders and stock with their exact types.Lesson 11
  12. 12Generics.CollectionsCount sales per city with TDictionary and sort the result with TList, the generic collections in Free Pascal's Generics.Collections unit.Lesson 12
  13. 13TStringList in depthSort, search and store name=value pairs with TStringList, the string list from the Classes unit that every Free Pascal and Lazarus program uses.Lesson 13
  14. 14Procedural types and callbacksPass functions and methods as parameters in Object Pascal with procedural types and of object, the mechanism behind Lazarus events.Lesson 14
  15. 15Operator overloadingDefine +, * and conversions for your own types with advanced records in Free Pascal: a money type in cents that adds up like a number.Lesson 15
  16. 16Recursion and backtrackingSolve search problems with recursion and backtracking in Pascal: which pending invoices add up exactly to the amount of a payment.Lesson 16
  17. 17Quicksort and binary searchWrite quicksort and binary search in Pascal with open arrays and recursion, and see why searching a sorted list is so fast.Lesson 17
  18. 18Strings with StrUtils and FormatSplit, align, transform and mask text with the StrUtils functions and Format patterns in Free Pascal, working on a line from a CSV file.Lesson 18
  19. 19JSON with fpjsonRead and build JSON in Free Pascal with fpjson and jsonparser: walk an order, add up its lines and reply with a brand new JSON object.Lesson 19
  20. 20Project: a small bankBring classes, inheritance, generics and exceptions together in a small Object Pascal bank that refuses impossible withdrawals and frees all its memory.Lesson 20