NetTalk Central

Author Topic: HasAutoInc error NTWS 12.37  (Read 1614 times)

JohanR

  • Sr. Member
  • ****
  • Posts: 339
    • View Profile
    • Email
HasAutoInc error NTWS 12.37
« on: February 25, 2022, 10:05:17 AM »
Hi,

Clarion 10 11897 PE

I did get the error as described in the docs, also tried to comment out 'PROTECTED' as per the docs
However error remains, see attached


regards

Johan


Jane

  • Sr. Member
  • ****
  • Posts: 349
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: HasAutoInc error NTWS 12.37
« Reply #1 on: February 25, 2022, 03:34:37 PM »
That's not the error from the docs, Johan. 

The docs refers to illegal use of a private property.

And it looks as if Bruce has changed to a workaround to try to avoid the requirement to edit abfile.inc. 

The code in the doc references the (protected in old versions) property directly:  RM.Me.HasAutoInc = false

The code in your example (and in 12.37 I just downloaded) uses a METHOD rather than looking for the protected property:  GetHasAutoInc()


Looking at abfile.inc, my version of clarion 10 (10.0.12349) DOES have a method called GetHasAutoInc.

Looking at abfile.inc in clarion 9.1, the property HasAutoInc byte,protected exists but the method to retrieve it (GEThasAutoInc) does NOT exist.

So I'm guessing that the method was added to C10 some time after your version.

netweb.tpw for 11.37 on line 341 is checking for clarion versions less than 10 and assuming that higher versions DO have the GetHasAutoInc() method.  But apparently your version of C10 does not.

Since you've removed the PROTECTED attribute from the property in abfile.inc, you could probably change the code in your screen shot so it again reads like what is in Bruce's doc page and check the property directly:
If p_forceWrite and RM.Me.HasAutoInc = false  !8000

I'd make a backup copy of netweb.tpw and alter the code between lines 341 and 349.

Cheers,

Jane





JohanR

  • Sr. Member
  • ****
  • Posts: 339
    • View Profile
    • Email
Re: HasAutoInc error NTWS 12.37
« Reply #2 on: February 26, 2022, 02:34:43 AM »
Hi Jane

Thanks for your detailed response!

Made this change to NetWeb.tpw
Not sure how to check the minor version number of %cwversion

    #IF(%cwversion<11000)

If I understand the problem it should work fine till I upgrade to CW11 or NetWeb.tpw is changed


regards

Johan

Jane

  • Sr. Member
  • ****
  • Posts: 349
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: HasAutoInc error NTWS 12.37
« Reply #3 on: February 26, 2022, 11:15:30 AM »
It occurs to me, Johan, that a better fix might be to tweak the Clarion files, since I doubt you'll be updating to a different version of CW10.

You could try this.

Edit abfile.inc
Inside the FileManager class, add the line:
Code: [Select]
GetHasAutoInc                   PROCEDURE(),BYTE,VIRTUAL

Edit abfile.clw
Add the method:
Code: [Select]
FileManager.GetHasAutoInc  PROCEDURE()
  CODE
    RETURN SELF.HasAutoInc

Then you could set the NT template back the way it was and verify that it works.  That way you won't need to edit something each time you update NetTalk.


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11182
    • View Profile
Re: HasAutoInc error NTWS 12.37
« Reply #4 on: February 27, 2022, 11:35:01 PM »
yes, apparently this ABFile method was not available in all Clarion 10 releases, so those that aren't on an up to date Clarion 10 should manually edit ABFILE.INC and ABFILE.CLW as Jane suggests.

Cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 339
    • View Profile
    • Email
Re: HasAutoInc error NTWS 12.37
« Reply #5 on: February 28, 2022, 04:50:03 AM »
Hi Jane

Your suggested edit of the ABfiles works like a charm!

Thanks

Johan