step

The step command continues running the program by executing the next line of source code, and then stops.

Syntax

step [ count ]
  1. count defines the number of lines to execute before stopping.

Usage

The step command allows you to "step" through your program, executing one line of source code at a time.

When a function call appears within the line of code, that function is also stepped through.

A common technique is to set a breakpoint prior to the section or function that is causing problems, run the program till it reaches the breakpoint, and then step through it line by line.

Using a count parameter will repeat the step command count times.

s is an alias for the step command.

Example

MAIN
    DEFINE x INTEGER

    FOR x = 100 TO 200
        DISPLAY x
    END FOR

END MAIN
$ fglcomp -M prog.4gl && fglrun -d prog.42m

(fgldb) break main
Breakpoint 1 at 0x00000000: file prog.4gl, line 4.

(fgldb) run
Breakpoint 1, main() at prog.4gl:4
   1     MAIN
   2         DEFINE x INTEGER
   3
-> 4         FOR x = 100 TO 200
   5             DISPLAY x
   6         END FOR
   7

(fgldb) step
        100
   2         DEFINE x INTEGER
   3
   4         FOR x = 100 TO 200
-> 5             DISPLAY x
   6         END FOR
   7
   8     END MAIN

(fgldb) step
        101
   1     MAIN
   2         DEFINE x INTEGER
   3
-> 4         FOR x = 100 TO 200
   5             DISPLAY x
   6         END FOR
   7