3.10. Setting Break Points

[<<<] [>>>]

In case you have a complex program and you want to debug only a certain part of it you need break points.

The command b sets a so called breakpoint at the line for which the line serial number is given. Issue the commands:

#b8
done
#b11
done
#l -

----------------------------------------------------- 001. print "hello\n" 002. a = 3 003. 004. sub MyFunction(t) 005. local a,b,c 006. 007. b = t + 2 * 008. print b 009. print " ",t 010. if t > 1 then MyFunction t-1 * 011. print " *" 012. end sub 013. 014. MyFunction a 015. >016. a = a + 2 017. 018. MyFunction a

----------------------------------------------------- #_

As you can see in the listing the lines are preceded by a * character. When the program is executed using the command r (or even R) the execution will stop when it reaches one of the break points.

Because many times programmers want to set a breakpoint on the actual line, if you issue the command b without argument it will set the breakpoint on the actual line.

#R

----------------------------------------------------- 006. 007. b = t + 2 *>008. print b 009. print " ",t 010. if t > 1 then MyFunction t-1

----------------------------------------------------- #_

To remove the breakpoints you should issue the command B. The command B n removes the breakpoint from the line n. The command b n-m removes all breakpoints that are on the lines from n to line m including the line n and line m. Both n and m are optional. For example B - removes all breakpoints.


[<<<] [>>>]