Andrew Pennebaker schrieb:
> In some languages, especially scripting languages, units can serve dual purposes. They can act as both a library and a self-sufficient program. RosettaCode describes this behavior as scripted main. If it's possible to compile a Pascal unit such that it executes initialization code as if it were a typical program/begin/end file, then this dual behavior can be achieved.

In Pascal, units are only libraries of code. You need a separate program that loads the unit (with "uses") to get an executable. If you don't reuse the code in the unit you don't even need a unit, just write a program with the code. Units serve the only purpose of code libraries you can use in multiple programs.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to