• Keine Ergebnisse gefunden

General APL Input

Im Dokument MANUAL APL (Seite 22-25)

.00

The fol lowing paragraphs define the APL character set, APL names, and various input/output characteristics.

Character Set

One of CP-6 APL's unique characteristics is the richness of its character set. An APL keyboard normally has 94 printing graphics. All of these are legal characters.

In addition. backspacing may be used to create the following overstrikes. all of which are legal characters:

A B. C. D. E. C. c[ H 1 .J. K £. If fJ. Q f g B ~ 1: fl

r

(! 1.

r

Z

Other legal characters are blank (the space bar). tab (the TAB key. treated as one or more blanks). and carriage return (the RETURN key). Two other characters are also accepted for control purposes: the <CTL-O> sequence and the BREAK key discussed below under "Line Corrections during Input" and "Control Keys".

groups, workspaces, and statement labels have names; the fol lowing restrictions apply to these names:

1. All names except workspace names can contain from 1 to 79 characters. Workspace names can contain from 1 to 31 characters (see Section 8).

2. Names may be composed of letters, numbers, A, underlined letters, underlined At and underscore.

3. Names cannot begin with a number or underscore.

4. There can be no blanks embedded within a name.

5. A particular kind of name, cal led a distinguished name, begins with

O.

Some examples of names are:

~ fArBQ~~ BAl Sl234 TEHPERATURE OPW

User Input versus Computer Output

The user can enter input whenever the carrier or cursor is indented six spaces from the left margin. As soon as the user has typed any input and pressed the RETURN key, APL takes control. Characters entered by the user whi Ie APL is processing wi I I be

"stored" until APL has completed processing the previous input, printed any results, and prompted for more input (usually by indenting six spaces from the left margin).

User input and computer output are easily distinguished. Computer output usually begins at the left margin whi Ie user input is usually indented six spaces. For example:

)DIGITS 2 liAS 10

0.33 4 2

3+9 2+2 4+2

Everything at the left margin in this example is printed by APL. while everything which is indented is typed by the user.

Line Corrections during Input

A line can be corrected during input as long as the RETURN key has not been struck.

Simply strike the RUBOUT key, to delete characters up to the error and enter <ESC> R to retype the correct portion of the line. Then proceed with the entry of the line.

For example. suppose the user mistakenly types 30-20 instead of 30+20. The user can correct this as fol lows:

50

30-20\\\<R>

30+20 enter three RUBOUTS and <ESC> R

the system displays 30; user enters +20 system responds with 50.

Perhaps the simplest line correction method is to delete al I of the input with the control X character. Another correction method can be employed if the user discovers that a character has been omitted. As long as the RETURN key has not been struck.

the user can simply backspace to where the character is to be inserted (or enter

<ESC> V followed by the character at which to position). enter <ESC> J. and type it.

For example. suppose the user types the fol lowing I ine and notices that one left parenthesis is missing:

(10H)*2)+(20H)*2

By simply backspacing and typing the required left parenthesis. the user can enter

«10H)*2)+(20H)*2

This illustrates that it is not always necessary to enter characters in order. The user can leave blanks in a line, then backspace and fi I I them in. As a rule. APL interprets what the user sees at the terminal; this is known as visual fidelity. For more information on standard CP-6 input line editing, see the CP-6 Programmer

Reference Manual (CE40).

Execution and Definition Modes

From the user's viewpoint. CP-6 APL operates in two modes, execution mode and

definition mode. In execution mode, the processor responds to each line of input by taking a specified action or by performing requested calculations and printing a result. In the fol lowing printout. for example, the first I ine is a system command that causes the processor to take some action and to respond with a message. and the third line (3+9) performs a calculation, printing the results on the fourth line:

)DIGITS 2 WAS 10

3+9 0.33

System commands can be entered during execution or definition mode. Calculations are performed only in execution mode.

In definition mode. statements (that is, calculations) are saved as part of a defined function instead of being executed immediately. System commands issued in this mode.

however. are executed immediately. After functions are defined, they can be referenced in other defined functions or in statements entered in execution mode.

The user must type the del symbol

v

to begin definition mode, and another V to return to execution mode. See section 7 under Defined Functions, for a detailed description of definition mode.

Prompts

CP-6 APL has four ways of prompting for (that is, requesting) input: direct line prompt, function line prompt, evaluated input prompt, and quote-quad prompt. These are described below.

When APL is ready for user input rn immediate execution mode. it automatically moves six spaces in from the left margin. This is a signal to the user to enter a

statement or system command. Direct-line prompts are shown in the following example:

4 2

2+2 4+2

In this example. APL indented six spaces to prompt for user input. and the user entered the statement 2+2. The processor then printed the result of the calculation at the left margin. moved to the next line. and again indented six spaces to prompt for more input.

Im Dokument MANUAL APL (Seite 22-25)