I am trying to compile some code using BDS2006 and have received the following err:

[Pascal Fatal Error] Variants.pas (1035): F2092 program or unit 'Variant' recursively uses itself.

The code is highlighted by the debugger at the end of line 1035 which is the final end; statement for the Procedure VarCopyByRef. This error occurs in several programs that use the variants file. The variants.pas file uses Types and Sysutil, neither of which uses files that lead to a vrecursion of the Uses declarations recursing the Variants.pas file.

My interpretation of the error is that there is a reference between units that leads back to this file (I do ot see how it could occur) or something in the Procedure VarCopyByRef. This code is part of Delphi and has not been altered.

Can anyone shed some light on this? Is there a means of tracing this recursion in the debugger?

I've not had that problem. I also don't see how you can get it when I look through Variants.pas. Are you sure the file isn't damaged in some way? (Like missing an end or somesuch?)

I have gone through varients fairly closely and cannot find anything. THe BDS IDE also thinks its fine since it does not raise any errors regarding improper "end" statements etc...

I have also had trouble with declarations in the Uses section being flagged as unrecognized even though the path is included in both the browsing and library paths in the Options menu. I cannot identify any consistency in the selection of units identified as missing, but the programs still compile, so it looks like an IDE error, perhaps related to memory. This occurs on multiple machines and I have reloaded BDS. IS the program an excessive memory hog? This appears to be a separate problem that the recursion error in this thread, but I am finding these gremlins frustrating.

Alas, my first answer was a wild stab in the dark. You've done everything else I could think of.

As I know nothing more it might be worth investigating over at the codegear support forums.

Sorry I couldn't be of help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.