[fpc-pascal] Bls: Quick Modern Object Pascal Introduction, for Programmers

Michalis Kamburelis michalis.kambi at gmail.com
Tue Jun 21 11:47:37 CEST 2016


2016-06-21 8:15 GMT+02:00 Marc Hanisch <marc.hanisch at googlemail.com>:
> Thanks Michalis for your excellent work! It's very important to left the
> early 90s associated with Pascal programming behind us and to encourage new
> developers to have a look onto the modern aspects of Object Pascal!
>
> Maybe a little bit offtopic, but I have a question regarding the compiler
> directives: is there a way to tell Lazarus to use these directives in every
> new unit?
>

In Lazarus, you can choose the mode ("Object Pascal - default
(ObjFpc)") and $H+ ("Use AnsiStrings") in the Project -> Options ->
Compilation Options. This is equivalent to starting all your code with
"{$mode objfpc}{$H+}".

In fact, these are already the default: ObjFpc and $H+. So, if you're
using Lazarus for your development, these are already set at nice
default values.

It seems not possible to set the "{$writeableconst off}" (equivalent
to "{$J-}") using Lazarus options. Probably because it seems not
possible to do it using FPC command-line, so Lazarus would not have
how to communicate it to FPC. Seems like a simple omission, and a
bugreport to FPC would fix it:)

Regards,
Michalis



More information about the fpc-pascal mailing list