How to Debug Code

This article documents an advanced feature of VisionScript that is not necessary for most users.

VisionScript features a built-in debugger for understanding how your code works and finding the source of errors.

The debugger triggers when a Breakpoint[] runs in a program. This command stops your code in place and creates an interactive environment in which you can debug.

To debug a program, first add a breakpoint to your script:

Load["./image.jpg"]
Detect["cat"]
Count[]
Breakpoint[]
Say[]

Then, run your program:

visionscript program.vic

When your program reaches the breakpoint, the debugger will trigger.

The debugger looks like this:

[n,p,q,s,r,h] VisionScript Debug Mode >

The VisionScript debugger

The letters at the beginning are commands, which mean:

Made with ❤️ by capjamesg