Writing Your First Sheerpower Program
Sheerpower source code is written into a text file with the file type of
spsrc for the primary
program or
spinc for "include files".
Note: In Sheerpower, when specifying file paths, the '@' symbol at the beginning of a path
refers to the directory of the currently running program. This makes it easy to reference files
relative to your program's location,
enhancing portability and simplifying path management.
// This will open a file named 'data.txt' in the same directory as the running program
open file data_ch: name '@data.txt', access input
Sheerpower comes with its own
Integrated Development Environment editor called
SPDEV, but any text editor can be used, such
as
Visual Studio Code (VSC). In fact, Sheerpower has
extensions for VSC to make
writing, debugging, and running Sheerpower code fast and easy.
Validating and Running Your Sheerpower Program
To validate that your program has no typographical or syntax errors, from
SPDEV choose the
validate 
button. Any syntax errors or misspellings will be highlighted.
To run a Sheerpower program from within the SPDEV development environment, open it from the SPDEV
environment and choose the
run button

. This will
validate and then
run
the code.
To run a Sheerpower program from outside
of the development environment, double-click on the name of the file or include its name in a
batch or command file. You can also run a Sheerpower program from the command line by typing
sp4gl xxx where xxx is the name of the Sheerpower program.
Sheerpower programs can also be run from Visual Studio Code using the Sheerpower extension for VSC.
Security note:
Sheerpower will not run a program that lives in a temporary folder
(the user's %TEMP% folder and the like). It stops with the
message Cannot run SheerPower from a TEMPORARY folder and does
nothing else. This is deliberate. A program sitting in a temporary
folder is the classic shape of a dropped or downloaded script — the
way a great deal of malware arrives and executes — so declining to
run from there closes off a common attack path for every Sheerpower
installation.
Keep your programs in an ordinary folder of your own (a project folder,
your Documents, a source tree). This matters most for tools and AI
assistants that generate a Sheerpower program on the fly to do a job:
write the generated file beside the tool or under the project, never
under %TEMP%, or the run will stop at that message and wait.
Sheerpower has no
main() routine. Instead, programs start execution at the first source
line.
Long Term Upward Compatibility
Sheerpower runs under all versions of Windows Desktop and Windows Server that
have been released over the last 10 years. Great care is taken to keep
Sheerpower upward compatible with older versions of itself. Sheerpower code
written 10 years ago will continue to run into the future. This greatly
reduces code maintenance costs and allows developers to focus on developing
new code instead of refactoring old code.
Because of Sheerpower's high-speed compiler, it is efficient to write and
test code in small increments. While in the Sheerpower Development
Environment, errors are reported instantly and are highlighted, explained,
and clickable for rapid correction and recompiling.
Sheerpower optimizes your time as a developer. You write less code. Your
time spent compiling code and experiencing coding changes is amazingly short
- typically less than one second. Your debugging time is greatly reduced.
Sheerpower adds enjoyment to your programming life!
Sheerpower's language syntax is similar to that of PHP or Python. This makes
it easier to learn for both experts and beginners. Debugging is also quick
and easy due to its virtually instantaneous compiles, error reporting, and code profiling.
Feel free to edit the code below and then click on

to run your code.