Silverfrost Forums

Welcome to our forums

Back checking in Plato

8 Jun 2020 6:40 #25594

When using Plato in debug mode, my program fails after 8400 iterations due to a variable suddenly becoming UNDEFined. It gives me the subroutine and line number of the failure. Is there any way to back track through the code in debug mode to find where this variable is being 'UNDEFINED?' Thanks. E.J.

9 Jun 2020 2:48 #25597

It depends. There is no provision in the debugger for running a program in reverse, and an apparently 'undefined' variable need not even be truly undefined. Here is a short program to illustrate:

program undef
implicit none
integer i, j, k
j = Z'80608080'
k = Z'00100000'
do i=1, 5
   j = j + k
   print '(1x,I2,2x,Z8)',i,j
end do
end program

If you compile with just /debug and run the program from the command line, it will run normally. Inside the debugger, however, if you place a breakpoint on the line with 'print', during the second execution of the loop body you will see j as 'undefined' in the variables panel.

In your program, is the variable in question a local variable, a dummy argument or a module member? What is its type? Can you share the code with us?

9 Jun 2020 7:01 #25598

AKS

Can you confirm that you are using an FTN95 command line option such as /UNDEF or /CHECKMATE.

9 Jun 2020 7:37 #25601

When running Plato there is a Pulldown Window on the toolbar at the top which has Checkmate Win32 displayed in it. I don't know if that answers your question. Since yesterday I've removed some UNDEF errors by giving certain variables initial values. I'm at a point of failure where the UNDEF variable really is undefined. I will try to fix this and write again when I get another UNDEF error. I don't think that I can supply much of the source code. I cannot run from the Command window because the failures stop an executable from being made. Thank you for your kind help.

10 Jun 2020 12:33 #25603

Quoted from AKS I cannot run from the Command window because the failures stop an executable from being made.

The presence of undefined variables may be detected at

  1. compile time, in which case (depending on the compiler options in use) no OBJ and EXE may be produced, or

  2. run time, which can occur only if no compile-time undefined variables are present. As long as the same compiler options are used, there is no difference between EXEs produced from an IDE or the command line. If 'no executable can be made' is true, there can be no running of the non-existent EXE in Plato or the debugger.

Please login to reply.