NetTalk Central

Author Topic: Compile Errors - Routine/Goto label duplicated  (Read 3675 times)

keitho1122

  • Guest
Compile Errors - Routine/Goto label duplicated
« on: April 18, 2013, 03:44:04 PM »
I have C8 and NT7

I'm still playing around with my first generated application.  I have four related tables - Teams, People, Weeks, Work.  There is a one to many raltionship down the hierarchy.  Teams have many people, a person has many weeks (in which they work) and weeks have many clients (whom they work for).  All of these relationships appear to have been defined correctly and in fact are the same definitions as in the Windows app version.

If I generate an application using just Teams and People it works.  When I add Weeks (so I choose to generate with Teams, People and Weeks) I get a number of compile errors as documented in the attachment.

The errors seem to relate to People table fields.

Thanks for your attention

Keith

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Compile Errors - Routine/Goto label duplicated
« Reply #1 on: April 18, 2013, 09:50:47 PM »
Hi Keith,

It would appear that on this form multiple entries for the same field, with the same Use Equate are being generated.
I suspect that will have to do with how your relationships fir together and so on.

So scan the form for duplicate fields (from the error message I'd say it's PEO:Name) and remove one of them, or change the Use Equate for one of them.

cheers
Bruce

keitho1122

  • Guest
Re: Compile Errors - Routine/Goto label duplicated
« Reply #2 on: April 23, 2013, 08:03:32 PM »
I have attached the offending dictionary.

Now, originally the dict had a lot more tables but I have redone it with just the three tables just to isolate the problem. These have been built from scratch – didn’t import any previous descriptions.  So, this is pristine with no possible baggage from previous editing.  The generated code is wrong but I don’t know why.

If anyone could use the dct to generate a new solution with C8/NT7 and can explain the three error messages I would appreciate it.  I'm stuck.

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Compile Errors - Routine/Goto label duplicated
« Reply #3 on: April 23, 2013, 09:46:08 PM »
goto BrowseWeeks procedure
notice that the column;
peo:name
is repeated.

Delete one of the columns.

The problem is caused by the wizard not being smart enough to handle the multi-component linking key relationship between the weeks table and the people table. It spots there is a relationship - and so offers you peo:name in the weeks browse (which you probably want over just seeing the peo:id) but then it gets over-excited because of the dual-field link.
I'll need to make it a bit smarter to handle that case.

Anyway, as I say, just delete the duplicate column.

As a secondary issue - if you look at the "tables" for that procedure you'll see it's linked the People table to the Weeks table twice. as in
WEEKS
  -- PEOPLE
  -- PEOPLE

You can remove one of those as well.

cheers
Bruce

keitho1122

  • Guest
Re: Compile Errors - Routine/Goto label duplicated
« Reply #4 on: April 25, 2013, 05:32:41 PM »
Thanks Bruce.  That worked and I now have an executable.  However, I am still trying to get rid of the 3x Warning messages viz:

Label duplicated, second used: WEEKS::STATE
Label duplicated, second used: WEEKS::STATE
Label duplicated, second used: PEOPLE::STATE

I thought that this would just be because the Wizaed had duplictaed or triplicated the Tables in the two procedures which are updateweeks and updatework

The problem is that when I select say updateweeks the Data/Tables window does not update so I cannot see the Tables that are associated with that procedure.  The same behaviour applies to the procedure updatework.

I don't know whether this is a C8 issue4 or NT7 but I suspect the latter.

Any ideas?

Keith

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Compile Errors - Routine/Goto label duplicated
« Reply #5 on: April 25, 2013, 09:19:01 PM »
Hi Keith,

You're right, those warnings are caused by the duplicate tables in the Data/Tables tree.
You should be able to highlight the duplicate, and then click the delete button. If not then that's an IDE issue, so you should just close the IDE, open it and try again.

cheers
Bruce

keitho1122

  • Guest
Re: Compile Errors - Routine/Goto label duplicated
« Reply #6 on: April 28, 2013, 01:40:29 PM »
Hi Bruce.  This is quite peculiar. After the Wizard generation and fixing the errors with the duplicated fileds you are still left with the warning messages that relate to the multiple table attachments to the procedure.  In my case there are two procedures - updateweeks and updatework.  In the case of both of these the IDE does not show their associated tables when they are highlighted.  If another procedure is highlighted and its tables are shown and then say updateweeks is highlighted then the table display does not change from the previous values.

Further, if you add a table to updateweeks then click off and back again it will not show the added table either.  I am just guessing but I would think that when the NT7 wizard incorrectly creates the procedure with the multiple tables it does something (or doesn't do something) which causes the IDE to act erratically.

The generated procedures are unusable and have to be deleted and recreated.

Cheers

Keith