Author |
Topic: Breakpoints and use of immediate. (Read 1371 times) |
|
bruceoboast
New Member
member is offline


Gender: 
Posts: 6
|
 |
Breakpoints and use of immediate.
« Thread started on: Dec 3rd, 2011, 7:51pm » |
|
I need to be able to make keyboard inputs while single stepping through a program. In QuickBasic, you could change the value of a variable by using the “Immediate” section of the debugging screen. Is there a way to do this in BB4W? The “Immediate button doesn’t seem to work that way.
Also, breakpoints could be set or reset while single stepping and breakpoints did not automatically reset when you hit them. If you came back to the breakpoint a second or more time, execution would pause again. This was very handy for jumping over large blocks of code. Is there anything similar in BB4W?
Bruce
|
|
Logged
|
Bruce
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Breakpoints and use of immediate.
« Reply #1 on: Dec 3rd, 2011, 9:29pm » |
|
on Dec 3rd, 2011, 7:51pm, bruceoboast wrote:Is there a way to do this in BB4W? |
|
The trouble with exiting to immediate mode in BBC BASIC is that (rather in the same way as with ON ERROR) the stack is cleared down. So you can't continue the program if it's in a PROC, FN or loop structure (e.g. FOR, REPEAT, WHILE). However if you only do it in the 'main loop', when the stack is empty anyway, it can be made to work.
Quote:Is there anything similar in BB4W? |
|
BB4W doesn't have 'breakpoints' as such, but if you insert a TRACE STEP ON in your code it will pause at that point and allow you to single-step. Since the 'breakpoint' is now part of the program it will take effect every time execution reaches that statement.
Richard.
|
|
Logged
|
|
|
|
admin
Administrator
member is offline


Posts: 1145
|
 |
Re: Breakpoints and use of immediate.
« Reply #2 on: Mar 9th, 2014, 10:18am » |
|
on Dec 3rd, 2011, 9:29pm, Richard Russell wrote:BB4W doesn't have 'breakpoints' as such, but if you insert a TRACE STEP ON in your code it will pause at that point and allow you to single-step. Since the 'breakpoint' is now part of the program it will take effect every time execution reaches that statement. |
|
Users of 'LB Booster' will be aware that the latest release of that tool does support breakpoints, and may be wondering how that is achieved given that it translates the program into BBC BASIC!
In fact what happens is that the breakpoint causes a TRACE STEP statement to be automatically inserted into the program at that point. In the context of BB4W therefore, inserting a TRACE STEP is to all intents and purposes the same as adding a breakpoint.
Note that a program will only pause at the TRACE STEP when run from the IDE. If 'compiled' to an executable the breakpoint will not cause execution to pause, but it may slow the program very slightly so ideally it's better to remove any breakpoints when they are no longer needed.
Richard.
|
|
Logged
|
|
|
|
|