Thanks, the conditional execution code helps a lot. Does $IFDEF look for an environment or Makefile variable?
Cheers, Andrew Pennebaker www.yellosoft.us On Fri, Oct 14, 2011 at 1:06 AM, Søren Ager <so...@agerklanen.dk> wrote: > On 2011-10-14 05:17, Andrew Pennebaker wrote: > > In some languages, especially scripting languages, >> > > Pascal is not a scripted language so it is not really something you want > (or should imo) to do in Pascal > > > Let's say I want to write a dual-purpose Fibonacci program, fib.p. It >> should: >> > > Then you should create 2 .p files 1 for the unit and 1 for the exe (that > uses the unit) > > > If you really want to do it you will have to do it with ifdef's: > > {$IFDEF exe} > program ScriptedMain; > {$ELSE} > unit ScriptedMain; > {$ENDIF} > > and do that with everything that is different between exe and unit - not an > elegant solution but it should work. > > > -- > > Hilsen > Søren > > ______________________________**_________________ > fpc-pascal maillist - > fpc-pascal@lists.freepascal.**org<fpc-pascal@lists.freepascal.org> > http://lists.freepascal.org/**mailman/listinfo/fpc-pascal<http://lists.freepascal.org/mailman/listinfo/fpc-pascal> >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal