thanks to the developers for the great tool! I have some improvements for simpler building and an assert failure in some files when formatting.
I have set up a build process for the JCF IDE version for Delphi 7, 2006 and 2007. But every time I download a new version of JCF I have to fix a few things to get the build process going. Maybe these settings are made on purpose, but if not it would be great to integrate my fixes in the main line.
1) In the file Utils\JcfUnicode.pas line 59 should be changed to
or else the file does not compile with Delphi 7 due to a type mismatch. Other than that - but in contrast to some postings here - the package compiles and works just fine with Delphi 7.
2) Both files Utils\JcfUnicode.pas and Utils\JcfUnicodeFiles.pas are missing in every .dpk file below D2007 (resp. D2006, D7 etc.) Of course one can add the Utils directory to the search path, but then you get an implicit unit import warning.
3) (This is new in version 2.38) The "Include" directory needs to be added to the unit search path, best as a relative path. In Delphi 7 in the .dof file
JcfIde7.dof | SearchPath=..\..\Include
in Delphi 2006 in the .bdsproj file
JcfIde2006.bdsproj | <Directories Name="SearchPath">..\..\Include</Directories>
and in Delphi 2007 in the .dproj file
JCFIde2007.dproj | <DCC_UnitSearchPath>..\..\Include</DCC_UnitSearchPath> at least in the release configuration section.
Likewise for D5/6 in the .dof file.
When formatting some of my files I get the following exception
JCF: D:\Delphi2007\Win32\openSOA\src\CoreServiceModule\config\XMLConfig.pas Exception EAssertionFailed Spaces to end is -5 (D:\Delphi\win32\Experts\JCF-2_38\Process\Returns\LongLineBreaker.pas, Zeile 217). Is there some debug mode that outputs my source line number that causes the error?
I submitted a new bug in the bug tracker and uploaded some example file that causes the error? Hope that helps.
Best regards,
christoph
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
and yes, it is an empty string ;-) Adding two WideChars result in a WideString, but Delphi 7 is not capable of broaden the type to WideString automatically, so we get a type mismatch. The purpose of the empty WideString is that the D7 compiler now uses the broadest type, i.e. WideString. So basically same here as adding two numbers, the interim result is of type of the broadest addend. Another option is to change the line to
Referring to the Exception EAssertionFailed (Sourceforge bug 2075894) I installed the new 2.39 version. Cool, now I get the line number and position of the error; but I noticed that the line number is not quite exact, it is always the line above the error!
The reason why my files do not format OK is a long line with compiler conditionals at the begin and end (e.g. line 312 or 385 in the example file)
JCF interprets the {$ENDIF} as a comment, so now I get the error
JCF: D:\Delphi2007\Win32\openSOA\src\CoreServiceModule\config\XMLConfig.pas Exception Exception Spaces to end is -5 on comment {$ENDIF} at on line 311 position 90.
Not sure if there is an easy solution to this, for now I break these lines just manually.
Thanks for the fast response, best regards
christoph
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
thanks to the developers for the great tool! I have some improvements for simpler building and an assert failure in some files when formatting.
I have set up a build process for the JCF IDE version for Delphi 7, 2006 and 2007. But every time I download a new version of JCF I have to fix a few things to get the build process going. Maybe these settings are made on purpose, but if not it would be great to integrate my fixes in the main line.
1) In the file Utils\JcfUnicode.pas line 59 should be changed to
{$IFDEF DELPHI7}
WideLineBreak = WideCarriageReturn + '' + WideLineFeed;
{$ELSE}
WideLineBreak = WideCarriageReturn + WideLineFeed;
{$ENDIF DELPHI7}
or else the file does not compile with Delphi 7 due to a type mismatch. Other than that - but in contrast to some postings here - the package compiles and works just fine with Delphi 7.
2) Both files Utils\JcfUnicode.pas and Utils\JcfUnicodeFiles.pas are missing in every .dpk file below D2007 (resp. D2006, D7 etc.) Of course one can add the Utils directory to the search path, but then you get an implicit unit import warning.
3) (This is new in version 2.38) The "Include" directory needs to be added to the unit search path, best as a relative path. In Delphi 7 in the .dof file
JcfIde7.dof | SearchPath=..\..\Include
in Delphi 2006 in the .bdsproj file
JcfIde2006.bdsproj | <Directories Name="SearchPath">..\..\Include</Directories>
and in Delphi 2007 in the .dproj file
JCFIde2007.dproj | <DCC_UnitSearchPath>..\..\Include</DCC_UnitSearchPath> at least in the release configuration section.
Likewise for D5/6 in the .dof file.
When formatting some of my files I get the following exception
JCF: D:\Delphi2007\Win32\openSOA\src\CoreServiceModule\config\XMLConfig.pas Exception EAssertionFailed Spaces to end is -5 (D:\Delphi\win32\Experts\JCF-2_38\Process\Returns\LongLineBreaker.pas, Zeile 217). Is there some debug mode that outputs my source line number that causes the error?
I submitted a new bug in the bug tracker and uploaded some example file that causes the error? Hope that helps.
Best regards,
christoph
Hi
What purpose does the "+ '' +" part serve? It's an empty string.
Hi,
sorry, I wasn't fully accurate here. The line for Delphi 7 should be
WideLineBreak = WideCarriageReturn + WideString('') + WideLineFeed;
and yes, it is an empty string ;-) Adding two WideChars result in a WideString, but Delphi 7 is not capable of broaden the type to WideString automatically, so we get a type mismatch. The purpose of the empty WideString is that the D7 compiler now uses the broadest type, i.e. WideString. So basically same here as adding two numbers, the interim result is of type of the broadest addend. Another option is to change the line to
WideLineBreak = WideString(WideCarriageReturn) + WideString(WideLineFeed);
with the same effect; it compiles fine as well.
Referring to the Exception EAssertionFailed (Sourceforge bug 2075894) I installed the new 2.39 version. Cool, now I get the line number and position of the error; but I noticed that the line number is not quite exact, it is always the line above the error!
The reason why my files do not format OK is a long line with compiler conditionals at the begin and end (e.g. line 312 or 385 in the example file)
{$IFDEF CSLOG} CSTracer.TraceMethod(Self, 'ReadNode', '...; Default ''%s''', [Default]); {$ENDIF}
JCF interprets the {$ENDIF} as a comment, so now I get the error
JCF: D:\Delphi2007\Win32\openSOA\src\CoreServiceModule\config\XMLConfig.pas Exception Exception Spaces to end is -5 on comment {$ENDIF} at on line 311 position 90.
Not sure if there is an easy solution to this, for now I break these lines just manually.
Thanks for the fast response, best regards
christoph
Ok, the "broadest type coercion" makes sense. I have checked in the version that goes:
WideLineBreak = WideString(WideCarriageReturn) + WideString(WideLineFeed);