| Previous | Contents | Index |
Other conventions used in this manual are:
| [ ] |
Optional portions of a statement are enclosed in
brackets:
INPUT [PROMPT str_expr] : var |
| { | } |
Braces combined with a vertical bar indicate that one
of the elements in the braces
must be chosen. The elements are separated by the
vertical bar:
EXIT {FOR | DO}
|
| [ | ] |
Brackets combined with a vertical bar indicates that
one of the options in the brackets
can be used. The elements are separated by the
vertical bar. Only one of the elements can be used:
DO [WHILE expr | UNTIL expr] |
| ... |
An
ellipsis indicates that the language element
can be repeated. An ellipsis following an option
enclosed in brackets indicates that you can repeat the format of the
whole option.
INPUT [PROMPT str_expr] : var, var... |
| dashes |
Three sets of dashes indicate a
block of code.
DO |
|
.
. . |
A vertical ellipsis indicates the continuation of a body of program code which is not a defined block of code. |
1.12 Presentation of Command and Statement Information
Part of this chapter and several other chapters in this Guide describe the commands and statements in the SheerPower language. The purpose of this section is to explain how the command and statement information is presented.
Statements that can only be used in connection with one another, such as if then or the select case statements, are described together. Each command and statement description includes the following information:
input [options] var [, var...] |
extract structure struc_name: key field = expr1 [to expr2]
---
--- block of code
---
end extract
|
The FORMAT contains the command or statement format. This includes the required keywords and the optional elements, if there are any.
Keywords are words that must be typed exactly as shown in the format. Keywords inside the program examples are shown in bold; e.g., extract structure, key, to, end extract. The elements in regular text represent information that must be provided by the user in order to use the statement. For example, "struc_name" (the structure name) must be provided by the user in this statement. "field" and "expr1" information must also be provided.
Keywords and elements in brackets are optional. Multiple options are separated with commas.
SheerPower is space sensitive, so spaces must be included where they are shown in the format. Either the single quote or double quote can be used as long as they are paired.
| Example 1-7 Presentation of command and statement information |
|---|
input 'Enter full name', timeout 30, elapsed x: name$ print name$ print 'Elapsed time: '; x end Enter full name? TTI Tester <---- type in your name here, then press the [Enter] key TTI Tester Elapsed time: 13 |
The EXAMPLE shows how the command or statement is used. Wherever possible, the example is a full program rather than a program fragment.
You are encouraged to type in (or copy/paste) the SheerPower examples into SPDEV throughout this manual and try running them.
In some cases, PURPOSE information is provided for usage clarity.
The DESCRIPTION tells about the command or statement, explains how it works, and other specific information.
Chapter 6, Built-in Functions of this Guide provides information on SheerPower's built-in functions, error and exception messages, and other general topics. You will want to get familiar with the built-in functions, as they will allow you to easily manipulate data.
Now that you have an idea of how to use this manual and work in SheerPower, the remainder of this Guide will provide the information you need to create and use SheerPower programs.
This chapter describes SheerPower debug facilities and how to use them. It also describes the commands that can be used in the SP4GL Console Window for debugging and experimentation purposes.
To open the SP4GL Console Window, click once on the SP4GL
Console Window icon inside SheerPower Rapid Development
Environment (SPDEV) in the top toolbar---the square with a lightning
bolt through it.
While writing a program in SPDEV, the SP4GL CONSOLE WINDOW (also referred to as the "console window") is utilized for debugging and experimentation purposes.
When using the scrollbars on the console window, the maximum number of scrollback lines is 500. |
SheerPower COMMANDS cause SheerPower to take some action immediately. SheerPower commands are not normally used inside programs. Here is a list of SheerPower commands that are generally used only in the console window:
SheerPower STATEMENTS are used inside program files (.SPSRC files inside SPDEV).
When a SheerPower statement is used inside the console window, it becomes a COMMAND. For example, the PRINT statement becomes a command when used in the console window. All SheerPower statements are available to be used as commands while debugging inside the console window.
The SP4GL Console Window is a limited editing environment. One or more commands can be performed at a time. Multiple commands must be separated by a backslash. If the line ends with a backslash, additional commands can be entered on the next line. The following example shows a single PRINT command inside the console window.
To perform the following example, open the SP4GL Console Window by
clicking on the SP4GL Console Window icon in the SPDEV
toolbar. Inside the console window, type:
print 'Hi there!'
and press the [Enter] key.
| Example 2-1 Print command in the SP4GL Console Window |
|---|
print 'Hi there!' //<--- your entry Hi there! <--- result |
In the SP4GL Console Window, if you type in the name of a variable and press [Enter], it will assume you want to print out the value of that variable. Therefore, the PRINT command is not necessary to type in. |
Type the example below into the console window:
| Example 2-2 Entering multiple commands in the SP4GL Console Window |
|---|
for i = 1 to 10\ print i\ next i 1 //<--result 2 3 4 5 6 7 8 9 10 OR: for i = 1 to 10\print i\next i 1 //<--result 2 3 4 5 6 7 8 9 10 |
Here is another example you can try typing inside the console window. Note that the date$ function will return the current date. This will be different than the date you see returned in this example.
| Example 2-3 Print command in the SP4GL Console Window |
|---|
date$ //<--press [Enter]
20010710 //<--result
|
The SP4GL Console Window 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 SP4GL Console Window icon in the SPDEV toolbar.
Inside the console window, type:
| Example 2-4 Command recall in the SP4GL 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.1.2 Using the [Tab] Key Features
When in the console window, 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.
| Previous | Next | Contents | Index |