[Lazarus] Word of warning when sharing code between Delphi and FPC

2008-08-29 Thread Graeme Geldenhuys
Hi Everybody, I have been battling with some code in tiOPF that causes problems when compiled with Delphi 2007, but not with Delphi 7 and FPC. After some head scratching, we found the problem. I use {$IFDEF DEBUG} quite often in my code, to hide things like writeln() statemens. I then have a

Re: [Lazarus] Word of warning when sharing code between Delphi and FPC

2008-08-29 Thread Mattias Gärtner
Zitat von Graeme Geldenhuys [EMAIL PROTECTED]: Hi Everybody, I have been battling with some code in tiOPF that causes problems when compiled with Delphi 2007, but not with Delphi 7 and FPC. After some head scratching, we found the problem. I use {$IFDEF DEBUG} quite often in my code, to

Re: [Lazarus] Word of warning when sharing code between Delphi and FPC

2008-08-29 Thread Michael Van Canneyt
On Fri, 29 Aug 2008, Mattias Gärtner wrote: Zitat von Graeme Geldenhuys [EMAIL PROTECTED]: Hi Everybody, I have been battling with some code in tiOPF that causes problems when compiled with Delphi 2007, but not with Delphi 7 and FPC. After some head scratching, we found the

Re: [Lazarus] Word of warning when sharing code between Delphi and FPC

2008-08-29 Thread Graeme Geldenhuys
On Fri, Aug 29, 2008 at 9:27 AM, Mattias Gärtner [EMAIL PROTECTED] wrote: Will FPC do the same in Delphi mode? It's nothing todo with the compiler, it's the IDE that injects '-dDebug' when the project is compiled in Debug mode. I would guess (though not tested), that '-dRelease' is injected

Re: [Lazarus] Word of warning when sharing code between Delphi and FPC

2008-08-29 Thread mitya boyarintsev
how about, redirecting writeln's somethere in Delphi Debug mode? something like that. I'm not sure if it works initialization {$ifndef fpc}{$ifdef debug} AssignFile(output, 'redirstdout.txt'); Rewrite(output); {$endif}{$endif} finalization {$ifndef fpc}{$ifdef debug} CloseFile(output);

Re: [Lazarus] Word of warning when sharing code between Delphi and FPC

2008-08-29 Thread Graeme Geldenhuys
2008/8/29 mitya boyarintsev [EMAIL PROTECTED]: how about, redirecting writeln's somethere in Delphi Debug mode? something like that. I'm not sure if it works After thinking about it for a while it hit me!! The code I'm working with is from the tiOPF project. It already has a solution via