PxPlus User Forum

Main Board => Discussions => Language => Topic started by: Gilles on February 09, 2021, 08:34:38 AM

Title: Dump
Post by: Gilles 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?
Title: Re: Dump
Post by: Mike King 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: 

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.
Title: Re: Dump
Post by: Gilles on February 09, 2021, 09:49:52 AM
Thank you Mike, it's clearer now.