NetTalk Central

Author Topic: Error Messages popping up  (Read 4072 times)

Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Error Messages popping up
« on: November 03, 2011, 08:56:14 AM »
Hi all,

I am struggling Error Messages popping up when they shouldn’t do it.

I have a simple loop but when no record is found, despite of what code version I use (see below) a message box appears “Record not found”. I don’t get it, why is that message popping up when using TryNext or doing the loop in the legacy way?

The option “Suppress Error Messages” in the WebServer procedure is checked so that cannot causing this. Furthermore the app is running on my desktop and not as a service. Didn't try yet what happens if I remove the SelfService template.

My two versions of code:
TTM:SessionId              = p_web.SessionId
TTM:ActiviteitRegelID = 0
SET(TTM:TTM_pkey,TTM:TTM_pkey)
LOOP UNTIL Access:TagTerugmelden.TryNext()
  IF TTM:SessionId <> p_web.SessionId THEN BREAK .
  DO Something
END


TTM:SessionId              = p_web.SessionId
TTM:ActiviteitRegelID = 0
SET(TTM:TTM_pkey,TTM:TTM_pkey)
LOOP
  NEXT(TagTerugmelden)
  IF ERRORCODE() THEN BREAK .
  IF TTM:SessionId <> p_web.SessionId THEN BREAK .
  DO Something
END

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Error Messages popping up
« Reply #1 on: November 03, 2011, 02:38:45 PM »
I would try a couple of things. First add some debug points p_web._trace('whatever') around your code to ensure this is where the error is being generated.

If indeed it is the code you posted causing the error, make sure the file is open before the code runs by explicitly opening it - don't assume it is open.

HTH's

Kev

Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: Error Messages popping up
« Reply #2 on: November 03, 2011, 03:54:56 PM »
Hi Kevin,

Thanks, but that is not the problem. I already had several debug points  like you suggest and I am sure the file is open. In fact the loop is working good. There is some counting done in it and the result is as expected.

It seems that the error which breaks the loop as it should do is not “cleared”. To be sure I put a message myself after the loop.  That message appears first and then the error message is appearing. Strange, it must be a setting of NetTalk somewhere but I cannot find it. Sure it is not the option “Suppress Error Messages” in the WebServer procedure what is missing because that one is checked.
TTM:SessionId         = p_web.SessionId
TTM:ActiviteitRegelID = 0
SET(TTM:TTM_pkey,TTM:TTM_pkey)
LOOP
  NEXT(TagTerugmelden)
  IF ERRORCODE() THEN BREAK .
  IF TTM:SessionId <> p_web.SessionId THEN BREAK .
  NumberTagged += 1
END
MESSAGE('NumberTagged: ' & NumberTagged) ! Is popping up first
! And now the error message pops up.

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: Error Messages popping up
« Reply #3 on: November 03, 2011, 04:35:50 PM »
It's a clarion message not Nettalk.

From your post below it appears the message is nothing to do with the code you posted as the error message pops up after (and not before) your debug point.

Generally that error pops up on a record update (ie there is no record in the buffer to update) so that's what I would be searching for...

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Error Messages popping up
« Reply #4 on: November 03, 2011, 10:32:46 PM »
Use NEXT not TRYNEXT.

Also - I agree with Kevin - the error is almost certainly not from this bit of code.

more importantly - what error are you getting? Perhaps the contents of the error gives you a clue to what is wrong?

This has nothing to do with the "suppress errors" - that's purely for communication errors generated by the NetTalk classes.

Cheers
Bruce

Koen Tjoa

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • Email
Re: Error Messages popping up
« Reply #5 on: November 04, 2011, 04:21:19 AM »

Hi Kevin and Bruce,

You got me on the right track. I was too much focused on my own code and not looking where had put it.

My loop counts the number of tagged records and was put in the same place where the actual tagging is done. Like demonstrated in the Tagging (48) example. But then I noticed a statement p_web._updatefile(TagTerugmelden) what was done after my loop.
Obviously I had put the loop in the wrong place, it is now at the very end of the Validate::TTM:Tagged routine, just before closing the files.

Thanks for thinking with me.
Cheers,
Koen