unit PortsIOLog; interface {$IFDef LogPortIO} procedure LogStrLn(const aStr:string); register; {$EndIF Def LogPortIO} IMPLEMENTATION {$IFDef LogPortIO} var LogFile:text; const cLogFileName='C:\PortIO.log'; procedure LogStrLn(const aStr:string); begin writeln(LogFile, aStr); end; INITIALIZATION Assign(LogFile,cLogFileName); Rewrite(LogFile); FINALIZATION Close(LogFile); {$EndIF Def LogPortIO} END.