PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Dump  (Read 290 times)

Gilles

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Dump
« on: February 09, 2021, 08:34:38 AM »
We have an error handler in wich we do a dump * to a file

! ****************************
! Level=3
! PGN="/usr2/piecepgm/SOUCON3"
!  Statement......1745
!  GO SUB.........0300

What does mean GO SUB .....0300 ?
There is no Gosub to line 300 in this program.

Another one :

! ********************************
! Level=2
! PGN="/usr2/piecepgm/DEMREFETAI"
!  Statement......1120
!  FOR............0670

What does mean the FOR .....0670?

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3475
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Dump
« Reply #1 on: February 09, 2021, 09:38:48 AM »
The GOSUB/FOR means that when the dump occurred there was an ACTIVE GOSUB or FOR on the program stack. 

The line numbers beside the GOSUB/FOR are where to return to: 

  • In the case of a GOSUB, when your logic does a RETURN, control will transfer to line 0300.
  • In the case of the FOR, when your logic executes the corresponding NEXT, if there are more iterations of the loop required control will resume at line 670.
Generally the return address will be either the same line where the GOSUB/FOR directive occurred or the line immediately following the directive should it be at the end of the line.

In your case, likely there is a GOSUB at the end of the line immediately before line 0300.  We do not record the line number of the GOSUB itself when it is at the end of line since it makes no sense to return the that line, but rather we record the next line.

Gilles

  • Silver Member
  • ***
  • Posts: 26
    • View Profile
Re: Dump
« Reply #2 on: February 09, 2021, 09:49:52 AM »
Thank you Mike, it's clearer now.