mirror of
https://github.com/QB64Official/qb64.git
synced 2024-09-04 11:10:15 +00:00
F9 (or clicking a line number) will toggle a breakpoint; When running a program, F8 will pause/step line by line, F9 will still be usable to toggle breakpoints and F5 will continue execution. ESC exits $DEBUG mode.
51 lines
1.3 KiB
Text
51 lines
1.3 KiB
Text
$CHECKING:OFF
|
|
SUB vwatch (linenumber AS LONG)
|
|
STATIC AS LONG ide, bypass
|
|
|
|
IF bypass THEN EXIT SUB
|
|
|
|
endc$ = "<END>"
|
|
|
|
IF ide = 0 THEN
|
|
start! = TIMER
|
|
DO
|
|
ide = _OPENCLIENT("TCP/IP:9000:localhost")
|
|
_LIMIT 30
|
|
LOOP UNTIL ide <> 0 OR TIMER - start! > 10
|
|
IF ide = 0 THEN bypass = -1: EXIT SUB
|
|
|
|
me$ = COMMAND$(0) + endc$
|
|
PUT #ide, , me$
|
|
|
|
'start! = TIMER
|
|
DO
|
|
GET #ide, , temp$
|
|
buffer$ = buffer$ + temp$
|
|
LOOP UNTIL INSTR(buffer$, endc$) > 0 'OR TIMER - start! > 2
|
|
|
|
buffer$ = LEFT$(buffer$, INSTR(buffer$, endc$) - 1)
|
|
IF buffer$ <> "vwatch:ok" THEN
|
|
CLOSE #ide
|
|
bypass = -1
|
|
EXIT SUB
|
|
END IF
|
|
END IF
|
|
|
|
DO
|
|
temp$ = "line number:" + MKL$(linenumber) + endc$
|
|
PUT #ide, , temp$
|
|
buffer$ = ""
|
|
DO
|
|
GET #ide, , temp$
|
|
buffer$ = buffer$ + temp$
|
|
LOOP UNTIL INSTR(buffer$, endc$) > 0
|
|
|
|
buffer$ = LEFT$(buffer$, INSTR(buffer$, endc$) - 1)
|
|
IF buffer$ = "run" THEN
|
|
EXIT SUB
|
|
ELSEIF buffer$ = "free" THEN
|
|
bypass = -1
|
|
EXIT SUB
|
|
END IF
|
|
LOOP
|
|
END SUB
|