A Guide to the Sheerpower Language

Previous Contents Index

2.2.1 Sheerpower Console Window Keystrokes

In the console window the cursor can be used to select (highlight) text on the screen.

Below is a table containing the special keystrokes available when working in the console window.

Table 2-1 Sheerpower Console Window
Keystroke Function Performed
ctrl/a selects all text (both on and off screen)
ctrl/c places selected text into the clipboard
ctrl/m places contents of message history into the clipboard
ctrl/t places contents of screen (including scroll buffers) into the clipboard

2.2.2 Recalling Previous Commands in the Sheerpower Console

The console handles command recall. The user can recall the last 100 previously entered commands by using the UP and DOWN arrow keys.

To perform the following example, open the console window by clicking on the Console Window icon in the SPDEV toolbar. Inside the console window, type:

Example 2-4 Command recall in the Console Window

print date$                   <--- type this line in and press [Enter]
20010716    //<--result 
print date$(days(date$), 3)   <--- type this line in and press [Enter]
16-JUL-2001  //<--result 
print date$(days(date$), 3)   <--- press the UP arrow key 
print date$                   <--- press the UP arrow key, then press [Enter]
20010716  //<--result 

2.2.3 Using the [Tab] Key Features

When in the Sheerpower console, the [Tab] key can be used to perform various operations that cut down the time it takes to debug program code. As you get familiar with Sheerpower and the Sheerpower language, you will find that the [Tab] key features can be very helpful. Command Completion in the Console Window

In the console window, enter part of a command and then press the [Tab] key. Sheerpower will then supply the full name of the command. If the command is ambiguous, a selection menu of all valid choices will appear.

In the following example, Sheerpower completes "so" to form the command "sort".

Open the console window by clicking on the console window icon in the SPDEV toolbar. At the flashing cursor in the console window, type in the word "so". Press the [Tab] key and you will see "so" completed to be the command "sort".

Example 2-5 Command Completion in the Console Window

so[Tab]  <--- your entry, press [Tab]
sort  <--- Sheerpower supplies 

Next, type the word "in", then press the [Tab] key. In this example, "in" is ambiguous, so Sheerpower provides a menu of choices:

Example 2-6 Command Completion in the Console Window

in[Tab]                                    +--Choices---+                 
                                           |  include   | 
                                           |  inf       | 
                                           |  input     | 
                                           +------------+ Spelling Correction of Commands in the Sheerpower Console Window

The [Tab] key can be used to correct misspelled commands in the console window. Just position the cursor on the misspelled word using the left and right arrow keys and press the [Tab] key. The word will be replaced with its correct spelling. In the example below, the misspelled command SET STRUCTRE is changed instantly to the correct command spelling when the [Tab] key is pressed.

To perform the following example, open the console window by clicking on the Console Window icon in the SPDEV toolbar. Inside the console window, type:

Example 2-7 Spelling Correction in the Console Window

set structre[Tab] //<-- press [Tab]
set structure 

Another example is below:

prannt[Tab] //<-- press [Tab]

Spelling Correction in SPDEV

Spelling correction of statements will also work in SPDEV. However, the console window and SPDEV use different methods to perform command completion. Therefore, they will not always agree on which command or statement you are wanting to complete. The [Tab] key is also used in SPDEV to execute the spelling correction.

In order for spelling correction with the [Tab] key to work in SPDEV, you must be editing an .SPSRC or .SPINC Sheerpower source file. Expanding Abbreviations

Sheerpower uses abbreviations for a number of commands in the Console Window. The [Tab] key can be used with any of the specific abbreviations to expand the abbreviations. To use this feature, enter an abbreviation and then press the [Tab] key. The period '.' must be used after each abbreviation. If an abbreviation is typed incorrectly a beep will sound when the [Tab] is pressed. The current abbreviations that can be used are:

e. edit
ee. end extract
es. extract structure
ex. exclude
fe. for each
in. include
l. list
li. line input
lm. line input menu
ls. line input screen
oc. open #
os. open structure
p. print
pa. print at
pc. print #
pe. print _extracted
pu. print using
ss. set structure

SPDEV also supports the use of abbreviations and expansions to speed up and simplify programming. See Section H.6.1.1, Expansions and Section H.6.1.2, Abbreviations for instructions on setting up these features.

2.3 Using Commands & Statements in the Console Window

2.3.1 BUILD


        [BUILD 'file_path\program_name'] 


Example 2-8 BUILD Command in the Console Window - Full File Path

build 'c:\sheerpower\samples\send_email.spsrc' 
Building c:\sheerpower\samples\send_email.spsrc ... 
Lines processed: 202 (20200/sec), code space used: 4KB   


Use the BUILD command to compile/build a program in the Sheerpower Console. Any errors will be displayed in the console when you perform the BUILD command.


The BUILD command used in the console window defaults to the main Sheerpower folder c:\sheerpower. When building a program that stored outside the Sheerpower folder, the full file path (location) of the program must be specified.

2.3.2 RUN


        RUN ['file_spec'] 


Example 2-9 RUN Command

run 'c:\sheerpower\samples\eval' 
c:\sheerpower\samples\eval.spsrc  15-MAY-2015 14:46 


The RUN command is used to execute a program after it has been written inside SPDEV. This way you can remain inside the console window and run your program after you experiment with elements of your program.

The RUN command can be used on its own (without the file location specified):


The RUN command executes programs. RUN with no file specification runs the current program.

When Sheerpower executes the RUN command, Sheerpower displays a header with the program name, current date and time. Sheerpower then executes the program.

A file specification can be given with the RUN command. If a file specification is provided, Sheerpower searches for the file, loads it, and then runs it. If no file type is given, Sheerpower will use the default file type .SPSRC.

Previous Next Contents Index