Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 14 total
Thread Circular references
Fri, May 6 2016 6:53 AMPermanent Link

Matthew Jones

I thought circular references, where one of them is in the
implementation section of a unit, should not be a problem.

I seem to have tied myself in a knot in my code though - not sure how.
I can't break out of my circular references.

--

Matthew Jones
Fri, May 6 2016 7:24 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

> I thought circular references, where one of them is in the
> implementation section of a unit, should not be a problem.
>
> I seem to have tied myself in a knot in my code though - not sure how.
> I can't break out of my circular references.

Okay, I worked out that it was caused, somehow, by my deciding to tidy
up the order of my forms and units in the project. I'd like to have all
the forms and their children in a nice order, and the units likewise.
Turns out that causes circular reference errors.

If anyone can explain the requirement here, I'd much appreciate it.
Until then, I've reverted the order using version control.

--

Matthew Jones
Mon, May 9 2016 5:00 AMPermanent Link

kamran

Hi Matthew

So I had a similar problem. !!

But I fixed it by making sure that I defined my shared forms in the correct place.

e.g. to fix this you define the screens/forms after the "implementation" keyword.

So the circular references appear to be triggered by defining the shared forms  after the "interface" keyword.

As there "can be" 2 references to the "Uses" on any form; that is easily be defined in the wrong place.

See below illustration for shared forms uScreen1,uScreen2.....etc :
------------------------------------------------------------------------------------------------
unit uWelcome;

interface

uses WebCore, WebUI, WebForms, WebCtrls, WebCtnrs, WebLabels, WebBrwsr, WebBtns,
  WebIcons, WebEdits,WebData, WebLists, WebComps;

//DO NOT define shared forms above
.....................................................
....
....

implementation

Uses uScreen1, uScreen2, uScreen3;

// define shared forms above
--------------------------------------------------------

Hope that helps.


Thanks


Kamran


"Matthew Jones" wrote:

I thought circular references, where one of them is in the
implementation section of a unit, should not be a problem.

I seem to have tied myself in a knot in my code though - not sure how.
I can't break out of my circular references.

--

Matthew Jones
Mon, May 9 2016 2:47 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Okay, I worked out that it was caused, somehow, by my deciding to tidy up the order of my forms and units in the project. I'd like to have all the forms and their children in a nice order, and the units likewise. Turns out that causes circular reference errors. >>

Example ??

Tim Young
Elevate Software
www.elevatesoft.com
Tue, May 10 2016 3:38 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> << Okay, I worked out that it was caused, somehow, by my deciding to
> tidy up the order of my forms and units in the project. I'd like to
> have all the forms and their children in a nice order, and the units
> likewise. Turns out that causes circular reference errors. >>
>
> Example ??

I will see if I can package my project, then adjust and break it again.
If so, I will send it to you.

--

Matthew Jones
Tue, May 10 2016 4:08 AMPermanent Link

Matthew Jones

Okay, I just did it, and re-arranged all the forms and units how I'd
like them (folders would be nice to group things, but that's icing). I
then hit compile, and it errored as it had an ", ," comma pair with
nothing in between. Deleted one, and it worked fine. Hmm. So I saved,
closed, opened again and it compiled fine, but the ordering was all
back to how it was before and not how I'd arranged it.

It's not really important, but just a nice to have, but as the project
grows finding the right unit to open becomes more important.

--

Matthew Jones
Wed, May 11 2016 4:06 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Okay, I just did it, and re-arranged all the forms and units how I'd like them (folders would be nice to group things, but that's icing). I then hit compile, and it errored as it had an ", ," comma pair with nothing in between. Deleted one, and it worked fine. Hmm. So I saved, closed, opened again and it compiled fine, but the ordering was all back to how it was before and not how I'd arranged it. >>

The ordering of what ?  The units in the uses clause, or the order of the units in the Project Manager ?

Tim Young
Elevate Software
www.elevatesoft.com
Thu, May 12 2016 5:21 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> << Okay, I just did it, and re-arranged all the forms and units how
> I'd like them (folders would be nice to group things, but that's
> icing). I then hit compile, and it errored as it had an ", ," comma
> pair with nothing in between. Deleted one, and it worked fine. Hmm.
> So I saved, closed, opened again and it compiled fine, but the
> ordering was all back to how it was before and not how I'd arranged
> it. >>
>
> The ordering of what ?  The units in the uses clause, or the order of
> the units in the Project Manager ?

I am not aware of the difference between them. I was just re-arranging
in the Project Manager. That appeared to break the project code uses
clause.

--

Matthew Jones
Thu, May 12 2016 2:18 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I am not aware of the difference between them. >>

The Project Manager controls the ordering of the project's units in the "contains" clause, whereas the "uses" clause is for non-project references.

<< I was just re-arranging in the Project Manager. That appeared to break the project code uses clause. >>

Okay, I'll see what I can find out.

Tim Young
Elevate Software
www.elevatesoft.com
Fri, Aug 26 2016 9:00 AMPermanent Link

Matthew Jones

Matthew Jones wrote:

>  re-arranged all the forms and units how I'd
> like them (folders would be nice to group things, but that's icing). I
> then hit compile, and it errored as it had an ", ," comma pair with
> nothing in between.

FWIW, I just had this issue again. Doing complex manouvering of the
forms and units in the Project Manager can break things. Initial error
was me trying to open a unit after re-arrangement, and it GPF'd. Saving
gave me an error, and then when I closed without saving, it had "lost"
half the forms and units. Looking at the last one showed the error
location, which was a ", ," pair with nothing in between in the uses
clause of the project file. There are also blank lines, which doesn't
matter much other than not looking pretty. 8-)

So however it happens, an empty unit name can cause trouble here.

--

Matthew Jones
Page 1 of 2Next Page »
Jump to Page:  1 2
Image