![]() |
Introduction to the REPL and Interrupting a Running Program |
You can open the Sheerpower console in several ways:
by starting SPDEV
, using Visual Studio Code
,
or typing sp4gl
at the Windows command prompt.
This launches the Sheerpower console, which functions like a
REPL
(Read–Eval–Print Loop) found in many other programming
languages.
A REPL is an interactive programming environment where you enter code,
have it evaluated immediately, and see the results printed right away.
In Sheerpower, you can also enter multiple statements on a single line by
separating them with a backslash (\
).
When a Sheerpower program is running in its console window, you might encounter a situation where the program is taking too long to complete, or you suspect it's stuck in an infinite loop. For these moments, Sheerpower provides a powerful built-in debugging feature.
By clicking anywhere in the console window to give it focus and then pressing ALT+B, you can immediately halt the program's execution.
This action does more than just stop the program—it drops you directly into the Sheerpower REPL (Read–Eval–Print Loop) at the exact point where the program was interrupted. The console will display the source file and line number where the halt occurred, giving you immediate context.
print variable_name
to
see the current value of any variable.go
to allow the
program to proceed from where it left off.stop
to terminate the
program completely or simply close the window.\
).go
, or stop execution entirely.
Hide Description
|
|
Enter or modify the code below, and then click on RUN |
Looking for the full power of Sheerpower?
Check out the Sheerpower website. Free to download. Free to use. |