ADUG 17 Feb 2020 Lazarus and Free Pascal What are they? -------------- Free Pascal is the compiler and linker multi platform (Windows, Mac OSX, Linux, etc) multi architecture (32 and 64 bit) Lazarus is the IDE and contains a visual component library (the "LCL" = VCL) forms have a .lfm extension project files have .lpi and .lps extensions How to get FPC and Lazarus? --------------------------- You can download both from the SubVersion repositories on Sourceforge, but a much easier route is to use: FPCupdeluxe download and install it from http://newpascal.org/download (it's a Windows program) select trunk for both Lazarus and FPC and let it download and build Lazarus you can add Mormot, Python and other modules easily at any later time and cross compilers (see later) Lazarus IDE include the AnchorDockingDsgn package (Packages/Install.Uninstall Packages...) so you have a more Delphi compatible docked window layout (read about docked layouts at http://newpascal.org/docked.html macros, key binding, edit and save to Project or IDE some keyboard shortcuts are different to Delphi (but many are the same) code completion is a little different (see https://wiki.freepascal.org/Lazarus_IDE_Tools#Code_Completion) Windows Demo ------------ "Proofreader" app Delphi screenshots of original app which used TRichview Lazarus/FPC Windows 32 bit app KMemo as replacement for TRichView (Google KControls) Language include {$mode delphi} at the top of your units tomake the FP language more Delphi compatible, especially: Generics TList or TList TDictionary see http://newpascal.org/assets/modern_pascal_introduction.html#_generics for more useful info Unicode € etc make sure your files are UTF-8 if you want to load them with LoadFromFile using the default encoding see https://wiki.freepascal.org/Character_and_string_types for more info on other available string types Debugging poorest feature (due to cross platform considerations) compared to Delphi but still very useable; Tooltip drill down of structured data is lacking Has call stack, breakpoints, watches, inspector, eval and modify windows can have a separate debug window layout from development layout (Tools/Manage Desktops) Cross compiler demo ------------------- Linux 64 bit use FPCUpdeluxe to install a cross compiler (i86-x64 and Linux in my case). Select a cross compiler on the Cross tab. Choose your new target and compile for eg Linux under Windows copy to your target platform eg Ubuntu linux and run. It may not always be as easy as I demonstrated; but I was very impressed! The option to set the target platform is documented here: https://wiki.lazarus.freepascal.org/IDE_Window:_Compiler_Options#Config_and_Target More reading ------------ Components (LCL) TStringGrid has enhancements such as alt row colouring, check boxes, sorting. see https://wiki.freepascal.org/TStringGrid TAChart. very complete equivalent of TChart. see https://wiki.freepascal.org/TAChart Help, tutorials, wiki and From the IDE open any of Tools/Example Projects and https://wiki.freepascal.org/Lazarus_Application_Gallery read and search https://wiki.lazarus.freepascal.org/ for lots of great help The newpascal site has a great pascal tutorial at http://newpascal.org/assets/modern_pascal_introduction.html Richard King