Chapter 10. FONT EDITOR

PILOT fonts can be used to display text in a wide variety of type sizes and 
styles. Several fonts are included with PILOT.  The font editor allows you to 
create new or modify existing fonts.  Within a PILOT program the NS: 
statement is used to select the font to be used at any particular point. 
Fonts are supported in any of the graphics screen modes (modes 4-16).  

A font is stored in a disk file with a suffix of ".PIF". Each font contains 
96 user-designed characters, corresponding to the characters with ASCII codes 
32 through 127.  This includes all the standard letters, numbers, and 
punctuation characters.  

Each character can be up to 24 pixels high and 24 pixels wide.  The 
individual character widths are used for proportional spacing. In addition to 
a width for each character, each font has a default character cell height and 
width. The default character cell size is used for row and column addressing.  

Each character is made up of a grid of pixels. Each pixel can be transparent, 
or one of three colors. Color numbers are 1,2 and 3, corresponding to the 
three foreground colors of mode 4 or 5. In higher resolution EGA modes the 
three colors can be assigned to any of the 16 or 64 colors available. A font 
can be designed in one color or in three colors. In a one color font, color 
number 3 is normally used. This permits the use of the TS: foreground command 
or the "#" foreground character for text color changes. Multi-colored fonts 
can be used to create special effects, such as shadow or outline fonts, or as 
small graphics.  

When displaying user-designed fonts, PILOT uses character 127 as the cursor. 
It is recommended that character 127 be a vertical bar, one pixel wide in the 
leftmost column of the character cell extending from the top of the tallest 
character to the bottom of the lowest character.  


USING THE FONT EDITOR 

The font editor, FE, is used to create and modify fonts.  FE stores a font in 
a file on disk for use in a PILOT program.  To use FE, enter: 

       FE name

where "name" is the name of the file you wish to modify or create. A suffix 
of ".PIF" is automatically appended to the end of the filename and need not 
be typed.  To use a file extension other than ".PIF" enter the entire file 
name on the command line. The file name may include a drive and/or path 
designation. If the file does not already exist, a new file is created. 
Otherwise, FE verifies that file is a valid font file, created by FE. If the 
file is not a font file, FE assumes that the file is a graphics image file in 
bit-mapped format. It could have been produced by GIE, the PILOT GSX: 
statement, or the BSAVE utility.  In any case, when the file subsequently is 
saved, it will be saved as a font file.  

Since FE can read in graphics image files, a previously designed font can be 
modified even if it wasn't created via FE.  Simply display all the characters 
in the font on the screen, and use a screen capture utility such as BSAVE to 
save the contents of the screen in a file.  


MAIN MENU 

When FE is first entered, the main menu is displayed.  From the main menu, 
there are four options.  The desired option is chosen with the function keys.  
The functions keys and their operations are shown below.  


F1 - edit characters 

F1 transfers to select mode. Select mode is used to choose an individual 
character to edit.  


F2 - change global parameters 

F2 brings up the menu to set character cell size and perform color 
modification of the font.  

F10 - save font 

F10 from the main menu saves the font on disk. A backup copy of the file is 
made, and saved in the file "name.bak", where "name" is the name of the file 
being edited, without the file extension. If an error occurs while saving the 
file, the previous version will be in the backup file.  


Shift F10 - abandon font 

Shift F10 exits the font editor without saving the file.  All changes made to 
the font during the current editing session are lost.  


SELECT MODE 

Select mode is used to choose the character to be edited.  When in select 
mode, the complete font is displayed on the screen.  One of the font 
characters is always highlighted.  The highlighted character is called the 
"current character".  On the left-hand side of the display there is a solid 
bar with a number and two boxes in it.  The number is the ASCII value of the 
current character.  The lower box shows the current character in the normal 
40 column text font, for use as a reference.  The upper box is called the 
"edit box".  The character in this box is called the "edit character".  

Action in select mode is controlled by the cursor and function keys. The 
possible operations are shown below.  


ARROW KEYS - change current character 

Selection of the current character is done with the arrow keys.  The arrow 
keys wrap around horizontally and vertically to make it easier to choose the 
desired character.  


F3 - pick from font

F3 copies the current character to the edit character box.  The width of the 
current character is also copied.  


F4 - put to font

F4 copies the edit character to the current character.  The width is also 
copied.  


F5 - micro-adjust 

F5 enters micro-adjust mode. Micro-adjust mode is used only for copying a 
character to the edit character box.  In micro-adjust mode, the cursor keys 
move the highlighted area by one pixel, rather than by one character. Also, 
the Home, PgUp, PgDn, and End keys can be used to move the highlighted area 
diagonally.  In micro-adjust mode, F3 picks the currently highlighted 
character and copies it to the edit box. F10 returns to select mode. F9 
transfers to fat-bits mode. An exit from fat-bits mode, returns to select 
mode, rather than micro-adjust mode.  

Micro-adjust mode is used for editing a font that was read in from a graphics 
image file.  In this case, the characters might not be in the right locations 
for a font file.  Using the micro-adjust keys, a character can be copied to 
the select character box.  Back in select mode, the character can be copied 
back to the font, in the proper character position.  

F9 - go to Fat-bits mode 

F9 transfers to fat-bits mode to edit the select character.  

F10 - exit 

F10 returns to the main menu.  

Esc - undo 

Escape undoes the action of the last pick, put, or undo. Warning: only the 
last pick, put, or undo can be undone.  


FAT-BITS MODE 

F9 from select or micro-adjust mode transfers to fat-bits mode. In fat-bits 
mode, the edit character can be edited.  The edit character is shown in an 
expanded format so that individual pixels can be identified and edited.  
Within the expanded font character, a small box-shaped pixel cursor shows the 
position of the currently selected pixel within the character grid.  

When in fat-bits mode, there are a number of indicators on the screen. The 
edit character is displayed in its normal size in the lower left-hand corner 
of the display. The character is bracketed by bars that indicate its current 
width.  The character width is used to determine placement of the next 
character when this character is displayed in a PILOT program.  Normally the 
width should be set to one or more pixels to the right of the rightmost pixel 
of the character shape.  If the width is less than the actual size of the 
character, the bars will overlay the character.  This is permissible and 
indicates that the following character might  intersect this character when 
displayed. Immediately below the character are five indicators, described 
below.  


Width - character width

The current width of the character is shown, in number of pixels.  When fat-
bits mode is entered, the width is set to the current width of the edit 
character.  


Set - pixel setting color and stream mode

This number is the current set pixel color.  In addition to a color number, a 
plus or minus sign may be displayed.  A plus sign indicates that stream set 
mode is on.  When stream set mode is on, the cursor keys automatically set 
each pixel as the cursor moves from one pixel to another.  A minus sign 
following the current drawing color indicates that stream clear mode is on.  
When stream clear mode is on, the cursor key automatically clears each pixel 
to the background color as the cursor moves from one pixel to another.  


Mode - font editor screen mode


Back - current background color  


Char - character indicator

The ASCII value from 32 to 127, and the standard 40 column text 
representation of the currently selected character.  These indicators are 
displayed only as a reference.  Note that the character shown is the 
currently highlighted character in select mode, not necessarily the edit 
character.  If you change the current character after picking the edit 
character, this character will not be the same as the edit character.  


Baseline Markers

Horizontal and vertical baseline markers can be set. These markers are saved 
when you exit to select mode, and are restored the next time you return to 
fat-bits mode.  Baseline markers are used only as reference points on the 
fat-bits grid to facilitate character editing.  


FAT BITS MODE KEYS  

The fat-bits mode keys are shown below.  


1, 2, 3 - choose drawing color 

Pressing 1, 2, or 3 sets the drawing color to that color.  


4, 5 - set screen mode 

Pressing 4 or 5 sets the screen mode.  


PLUS and MINUS - change background color 

The + key increments the background color.  The - key decrements the 
background color.  


ARROW KEYS, DIAGONAL KEYS - move cursor 

The arrow keys and Home, PgUp, PgDn, and End keys are used to move the pixel 
cursor.  The diagonal keys are useful when stream set or clear mode is on, to 
draw diagonal lines.  


F1 - set a pixel 

F1 sets the pixel at the pixel cursor to the current drawing color.  F1 also 
turns off either stream mode, if set.  


Shift-F1 - toggle stream set mode 

Shift-F1 toggles screen set mode.


F2 - clear a pixel 

F2 clears the pixel at the cursor to the background color.  F2 also turns off 
either stream mode.  


Shift-F2 - toggle stream clear mode 

Shift-F2 toggles the stream clear mode.


F3 - toggle horizontal mark 

F3 toggles a baseline mark in the current cursor row.  


F4 - toggle vertical mark 

F4 toggles a baseline mark in the current cursor column.  


F5 - invert the font character 

F5 inverts the color of each pixel in the character.  


Shift-F5 - clear font character 

Shift-F5 clears the entire character to the background color.  


F6 - rotate character 

F6 rotates the font character counter-clockwise 90 degrees.  F6 also clears 
either stream mode, if set.  


Shift-F6 - reflect character 

Shift-F6 reflects the font character about the vertical axis.  In conjunction 
with the F6 key, the character can be reflected about the horizontal axis 
also. Shift-F6 clears all stream mode.  


F7 - horizontal roll left

F7 rolls the font character to the left by one column.  The leftmost column 
becomes the rightmost column.  All of the roll keys clear either stream mode, 
if set.  


Shift-F7 - horizontal roll right

Shift-F7 rolls the font character to the right by one column.  The rightmost 
column becomes the leftmost column.  


F8 - vertical roll up 

F8 rolls the font character up by one row.  The top row becomes the bottom 
row.  


Shift-F8 - vertical roll down 

Shift-F8 rolls the font character down by one row.  The bottom row becomes 
the top row.  


F9 - decrease width 

F9 decreases the width of the character being edited by one pixel. The width 
indicators change to reflect the new width. The character itself is not 
changed.  The minimum width is 0 pixels. The width is used to determine the 
placement of any character which is displayed immediately after this 
character.  


Shift-F9 - increase width 

Shift-F9 increases the width of the character being edited.  The maximum 
width is 255.  


F10 - return to select mode 

F10 returns to select mode.  The character being edited is copied back to the 
edit character box.  The width is also copied. To copy the edited character 
back to the font as the current character use F4.  


CHANGING GLOBAL PARAMETERS 

From the main menu, the F2 key transfers to the global parameter menu from 
which the following keys may be used: 


F1, F2, F3 - set substitution colors 

A color substitution table can be built to make a mass change of all colors 
in the font. F1, F2 and F3 are used to set the new color for all pixels 
currently of colors 1,2 and 3, respectively. The substitution colors may be 
0, 1, 2 or 3. Substituting to color 0 has the effect of erasing pixels. The 
prompt line indicates the current settings for each substitution color. F5 
can be used to preview the effect of the color substitution table.  


F5 - view new colors 

The F5 key causes the whole font to be displayed with the new colors 
substituted in.  It does not change the font permanently.  


F6 - save new colors 

F6 causes the whole font to be displayed with the new colors substituted in. 
Once displayed, a prompt is asks if you are sure you want to save the font 
with the new colors.  If you respond with a 'y', the change is made 
permanently.  


F7 - set cell width 

F7 is used to set the default cell width for the font.  The cell width must 
be between 1 and 255.  


F8 - set cell height 

F8 is used to set the default cell height for the font.  The cell height must 
be between 1 and 255.  


F10 - return to main menu 


Chapter 12. TOUCH SCREEN


The touch screen is supported in two ways: "touch key mode" and "touch 
coordinate mode".  The two modes can be intermixed in any manner within a 
program. The touch key mode is used to detect selection of a pre-defined 
target on the display screen. The touch coordinate mode can be used to detect 
the exact location of a touch in graphics or text coordinates. The touch 
coordinate mode also permits the program to check for a touch without 
stopping to wait for a touch.  


TOUCH KEY MODE

The user can define up to 60 TOUCH KEYS on the display screen.  Each touch 
key is a rectangular block of character cells. The smallest possible touch 
key is one character cell; the largest is the entire display screen. Touch 
keys may overlap in any manner and need not fill the entire display area.  
PILOT does not take any automatic action to make the touch keys visible.  The 
user can choose to do so by creating an appropriate display which outlines or 
highlights the touch keys in any desired manner.  Internally, PILOT keeps a 
table of all current touch keys. Each touch key is identified by a number 
from 1 to 60. The following statements can be used to control the touch key 
table: 


TS:Kn  - define touch key

The current viewport is defined to be touch key n. n may be a number from 1 
to 60. The K command would normally be intermixed with other commands on the 
TS: statement. The following example defines two touch keys, number 2 and 
number 3. Each one has a label displayed in it.  

     TS: V2,7,5,9;K2;Astart; V40,50,6,12;K3;Astop
     TS:K0  - remove all touch key definitions 

The touch key table is erased. No touch keys remain defined.  

ACCEPT POINT 

To accept touch key input use the ACCEPT POINT statement, or the ACCEPT POINT 
EXCLUSIVE statement.  


AP:  - accept point 

Accept point waits for touch screen or keyboard input.  


APX:  - accept point exclusive 

Accept point exclusive waits for touch screen input only.  
     
The ACCEPT POINT works like a normal accept in that the program waits for 
student input.  In the case of AP: the student can either type a reply on the 
keyboard, followed by the ENTER key, or touch the screen. In the case of APX: 
the student must touch the screen to end the accept.  
     
In either case, if the student touches the screen, within a touch key, a 
"good beep" sounds and  the student answer buffer (%B) is set to the touch 
key number enclosed in square brackets, (eg. "[12]" ). If the student touches 
outside all touch keys then a "bad beep" sounds and the answer buffer is set 
to "[0]".  

If touch keys overlap, and a touch occurs within more than one touch key, 
then the lower touch key number is returned.  

Like the normal Accept statement, the AP: and APX: statements may contain 
variable names as arguments. For example: 
        
       APX: #Q

sets the numeric variable Q to the touch key number selected by the student, 
and sets the string variable %B to the same number, enclosed in  [ ].  

Example: Waits until the student touches a touch key, giving a bad beep on 
all other touches that may occur first.  

       APX: #Q
       J(Q=0):@A

The AP: statement allows the student to reply as to a normal Accept, using 
the keyboard, or by touching the screen. The program can detect which 
occurred by checking for the square brackets in the answer buffer as follows: 

       AP:
       M:[&]
       TY: touch screen used.
       TN: keyboard used.

The AP: and APX: op codes are subject to response timing in the same manner 
as the A: op code. The response time limit is set by a statement such as 

       P: T5    (set max response time to 5 sec)

Also, the function TIM(0) returns the actual student response time for the 
last Accept statement.  

If the ESCAPE option is enabled on the P: statement (P:E), then touch key 
number 1 has special significance. Touch key 1 is treated similarly to the 
student entering an "@" character, in that a USE is issued to label *SYSX. 
This can be used to implement a "hot spot" on the screen, which would invoke 
asynchronous events like help, menus, reviews etc.  


TOUCH COORDINATE MODE

The PNT function is used to control touch coordinate mode. PNT can be used in 
any expression context. The format of the PNT function is as follows.  

       PNT(n)

where n is a value of 0, 1 or 2.  

PNT must be called first with an argument of 1 to enable touch coordinate 
mode: 

       C: X = PNT(1)

Once this statement is executed, the touch screen is active.  The program can 
test for a touch having happened by  statement such as: 

       J(PNT(0)):TOUCH

The returned value is 0 if no touch has occurred, or 1 if a touch has 
occurred. If the value is 1, then four system variables have been set to 
reflect the location of the touch: 

%X  - the graphics x-pixel location of the touch
%Y  - the graphics y-pixel location of the touch
%R  - the text row number of the touch
%C  - the text column number of the touch

These system variables are set in the ranges that suit the current screen 
display mode.  The program can use these variables in any expression context.  

Whether or not a touch is returned by the PNT(0) function, the touch screen 
remains active. The program can deactivate the touch screen by executing the 
function: 

       C: X = PNT(2)

Example: This code sequence places an asterisk at any point touched by the 
user.  

       C:I=PNT(1)
       *LOOP  J(PNT(0)=0):LOOP
       TS:G(%C),(%R);A*
       J:LOOP


Chapter 13. SIMULATED SPEECH


       SS: n1, n2, n3 . . .

n1, n2 and n3 are decimal numbers which represent the speech vocabulary chip 
addresses of the words to be played back.  Each number is separated from the 
previous one by a comma or semi-colon.  

Multiple words on one line are spoken as a sentence.  

Example: simulated speech 

       SS: 1                 (say one word)
       SS: 5,3,7             (say three words)    

Chapter 14. VIDEO DISC SUPPORT

       VS: command-list

A PILOT program can control the operation of the attached video disc player. 
The visual output of the player can be displayed on the screen in combination 
with the computer-generated text or graphic display.  

The video disk image can be considered to be "behind" the computer display 
image. The program controls which parts of the video image and which parts of 
the computer display image are visible by selecting a color on the computer 
display image to be transparent. For example, if black is transparent, then 
the video disk image shows through wherever the computer display image would 
be black. Other colors in the computer display appear to be overlayed on the 
video disk image.  

The video disk unit can be controlled by the VS: , or VIDEO SUPPORT 
statement. VS: has a syntax similar to the TS: or G: statements, in that it 
can contain a list of a number of individual commands. If there is more than 
one command on a VS: statement, each must be separated from the previous one 
by a semi colon. For example: 

       VS: L1; A3; P100,675

In the following command descriptions, n represents a number, a variable or 
an expression.  

Video disk frame numbers run from 1 to (approximately) 54000.  The possible 
commands are a follows: 

An - select audio channels

Set audio control for subsequent play command, A0 means silence, A1 means 
left track, A2 means right track, A3 means both tracks. This may be issued 
prior to, or during a play command to turn the sound off or on at any time.  

Cm,p - mode and palette select

Set interlace mode and color palette selection. m=0 disables interlace mode, 
m=1 enables it. Interlace mode should be enabled during video display and 
disabled during graphics display to enhance the visual effect.  p=0 selects 
normal color palette and p=1 selects large color palette.  

The color palette determines how the transparency color number on the Tn 
command below is interpreted. In normal color palette mode the transparency 
color number is assumed to be in the range 0-15 and is interpreted as a color 
number corresponding to the 16 default colors. In the large color palette 
mode the transparency color is assumed to be in the range 0-63 and is 
interpreted as a color number as defined by the EGA color palette.  

Note that the "TS:Fn,m" command can be used to access the large color palette 
of the EGA.  

Dn - display player frame information 

Control the player-generated frame number display. D0 means frame number is 
not displayed on the screen, D1 means frame number is displayed on the screen 
whenever a video image is displayed. This command is provided for debugging 
purposes since it shows what frame number is currently being displayed.  

Fn - still frame

Search for frame number n, then play it as a still frame.  

H0 - soft system halt 

Command the display system to do a soft stop. The soft stop command should be 
issued prior to calling an external program.  It causes all video, touch and 
sound commands to stop at a logical point. Then software which expects a 
standard graphics adapter may be executed.  

H1 - restart after soft system halt 

Command the display system to resume special function modes after a previous 
soft stop.  This command leaves the system in a ready state with no video, 
touch or sound turned on.            

Ln - load or unload disk 

L0 means unload (spin down) L1 means load (spin up).  An L1 command MUST be 
issued prior to any attempt to play any video scenes. Once this command is 
issued, the PILOT program pauses until the disc is up to speed, or an error 
occurs. After this command the program should test the player status via the 
VFN function to insure that the disc unit is ready to go.  

Mn - enable or disable manual controls

The video disc player has manual remote controls. They can be disabled or 
enabled under software control. M0 means disable, M1 means enable.  

Pf,t - play a video scene from frame f to frame t. 

The video player plays the designated sequence of video frames. When frame 
number t is reached the player continues to show frame t in still frame mode.  

If f is less than t the scene is played forward. 

If f is greater than t, then the scene is played backwards.  If the first 
frame number, f is equal to 0, then the play begins at the current frame 
number and plays forward or backward to frame number t.  

The An command, shown above, can be executed prior to the play command to 
control whether the audio portion is present.  

An Rn command, shown below, can be executed prior to the play command to set 
the play rate.  

The program proceeds immediately after issuing this command to the video 
disc. It does not wait until the scene is complete.  If you wish the program 
to wait for the scene to complete see the VST and VFN functions below.  

A play in progress can be stopped at any time by a still frame command, an 
unload command, or a stop command.  

Rn - set play rate 

Set the play speed for subsequent play command. The value of n is in terms of 
percent of normal speed, from 1 to 255. If 0<n<100 then the play rate is 
slowed down to n percent of normal. If n>100 then play rate is increased to n 
percent.  R100 sets the play rate to normal. No audio is played when the play 
rate is slower or faster than normal.  

Sn -  single frame step 

S0 means step backward one frame, S1 means step forward one frame.  

T; - turn off transparency 

Set no computer display colors to transparent, so only the computer display 
is visible, the video image behind it is not visible.  

Tn - set color n to transparent 

The video image shows through the computer display image wherever the 
computer display image is color number n. See the "Cm,p" command above for 
information on the value of n.  

Un - select video player unit n 

When more than one player is attached, this command selects the player to 
which commands are sent. Player 1 is the default.  Once a player unit is 
selected, all player commands are routed to that player.  However, it is 
possible to be showing a scene from one player and giving commands to another 
by combinations of the Un and Vn commands.  

Vn - select video player output to display 

When more than one player is attached, this command selects the player whose 
output is displayed. Player 1 is the default.  It is possible to be showing a 
scene from one player and giving commands to another by combinations of the 
Un and Vn commands.  


X - stop a play-in-progress

The play command stops at the current frame and the current frame is played 
as a still frame.  


VIDEO FUNCTIONS

Each of these functions returns a number. Each can be used in any expression 
context.  


I = VFN(n)   - frame number

Returns current video frame number for player n. In a system with one player 
n should be equal to 1.  


I = VST(n)  - returns current status of player n

Returns the play status of player n. The status may be one of the following 
values: 

       -1  indicates an error condition
        0  disc not up to speed (parked/unloaded)
        1  disc up to speed, not playing (loaded)
        2  disc playing a still frame (stopped)
        3  disc playing a scene


Examples: 

       R: set up to show video in black areas
       VS:T0  


       R: spin up disc and check whether okay
       VS:L1           
       T(VST(1)<2):Player is not up to speed!


       R: play a scene with sound track 2.
       VS: A2; P100,575     
       R: Wait until the scene is done.
       *Loop  J(VST(1)=3):Loop  
     

       R: play from current frame, 50% speed
       VS: R50; P0,54000     
       R: Wait until at from 1000.
       *Loop1 J(VST(1)=3 & VFN(1)<1000):Loop1   
       VS: X                                      
       R: step 3 frames
       VS: S1; S1; S1                           


Appendix A.  Language Summary

Appendix A: PILOT LANGUAGE SUMMARY

STATEMENTS
            
A: [variables]                               accept answer
AS:                                          accept single
AH:                                          accept hold cursor
AX:                                          accept with default key codes
AJ:                                          accept with type-ahead
AP:                                          accept touch or keyboard input
APX:                                         accept touch screen input 

C: var = expr                                compute and assignment

D: var(len),...                              create arrays and/or strings
DX: v$(len)                                  create aligned string

E: [label]                                   end subroutine or program

FX: [name]                                   open or close a file
FI: byte,var$                                file in (read from file)
FO: byte,expr                                file out (write to file)
                   
FXH: size                                    initialize heap file
FIH: byte,vr$                                in heap (read from heap)
FOH: byte,expr                               out heap (write to heap)
                   
G: command-list                              turtle or sprite graphics
GSX:                                         save screen internally
GX:                                          restore screen
GX: name                                     display graphics image from file 
GSX: name                                    save graphics image to file name

J: label                                     jump to label

K: expression                                write to student records file
L: name[,label]                              link to program name

M:pattern                                    match student answer 
MJ:pattern                                   if NO, jump to next match
MS:pattern                                   match with spelling errors
MX:expression                                numeric match

N: pattern                                   new character
NX: x,y ;...                                 new key
NXS:                                         restore old keyboard codes
NS:variable$                                 change character font
NH:width,height                              change default character cell size

P: option-list                               problem start and options

PX: offset,byte                              poke byte to memory
PJ: address,byte                             output byte to port address

R: remarks                                   provides program comments
S: pit,dur;...                               sound
SS: address,...                              simulated speech

T: text                                      type text
TH: text                                     type hang (no return)
TX: text                                     type clear screen

TS: screen-list                              type screen

U: label                                     use (call) subroutine
                                
V: var$                                      call machine language
VS: command-list                             video disc control

W: expression                                wait expr  tenths of a second
WH: expression                               wait and hold character

X: expression                                execute indirect

P STATEMENT OPTIONS (P:)

S remove all spaces                 L trans to lower case
U trans to upper case               G allow  GOTO command
E allow ESCAPE cmd                  W clear  label  table
F func key escape                   P printer-echo on
An set max A: len                   Z turn off all options
Tn set max A: response time
Kname set keep file name for K: statement

STATEMENT LABELS

*label (alone)             *  followed by 1 to 6 characters
*label stmt (before stmt)

CONDITIONALS

TY:...                execute statement if last match YES
TN:...                execute statement if last match  NO
TE:...                execute statement if err  condition
Tn:...                (1-9) execute  if  answer counter=n
T(x<3):...            execute if  expression  is true
TC:...                execute if last expression was true


MATCH PATTERNS

*  any single char                &  any sequence of chars
!  alternate answer               %  match a space, or end
@  items any order                ^  negation of match


SCREEN COMMANDS (TS:)

Axx/yy  do animation            Bn   background  color
Dn  delay n 60ths sec           En   erase to  color n
Fn  foreground color            Gx,y   cursor goto x,y
Fn,a  color palette             On   overlay/xor  mode
Ln  set line spacing            Mn   screen mode (0-6)
Pn  select page (0-7)           Pn,w  displ/write page
Vl,r,t,b  set viewport          V;  restore viewport  
Wrlud  walk one space           ;  separates items    
*n(.)  repeat n times           Xn   set screen border


GRAPHICS COMMANDS (G:)

Cn  set pen color               E  erase entire screen
Cn,w  pen color width           Dx,y  draw to pixel x,y
Ar,d  arc, radius r             Bx,y  solid bar
Fn  forward n steps             Gx,y  turtle   goto x,y
Hn  set heading                 Rn   right  n  degrees
Ln  left n degrees              Xn   horizontal  scale
Yn  vertical scale              *n(..)  repeat n times
Pn  paint to color n            Wn  wait n 60ths sec
Svar$  sprite table             Sn  sprite n current
Jn  jump to sprite n            ;  separates items

SYSTEM VARIABLES

%A    answer counter         
%B    answer buffer
%E    jump loc of last U: return point
%N    item which matched on last match
%M    loc in %B which matched on last match
%L    len in %B which matched on last match

VARIABLES

X  cat  WRONG  W5      simple real variables
score(expr)            subscripted real variable
name$                  string variable, varying length
c$(pos)                single character substring
hard$(pos,len)         substring specified length

Names are 1-6 bytes,  start with a letter.
Upper/lower  case  are the same in a name.
Arrays start at 0. Strings start at 1.

OPERATORS AND EXPRESSIONS

+ add     - sub     * mul      / div    % modulo
& and     ! or       ~  not    !! concatenate
<    >    =    <=    >=    <>  relational

ABS ASC ATN AUX BGC CAP CHR COS CLK DEC EXP FGC  
FIZ FLO INS INP INT KEY LNE LOG LEN MEM MOD OFF
PEK RND RSP SEG SFL SGN SIN SPC SQR STR SWP TIM 
WRD XCR XPX YCR YPX

OUTPUT CONTROL CHARACTERS

8 LEFT        9 RIGHT       10 DOWN     11 UP
12 CLEAR     13 RETURN      14 HOME 

RUN TIME COMMANDS

P:G enables GOTO label, causes J:label

P:E enables Esc key to cause  U:SYSX

P:F enables function/cursor key to cause  U:SYSX

EZ EDITOR      EZ name.PIL       

up down right left arrows, tab move cursor
HOME goto top of file               END goto end of file
INS insert character                DEL delete character
PG UP move up a page                PG DN move down page
F1 insert line/split                F2 delete line/join 
F3 pick up a line                   F4 put down a line
F5 goto line/find str               F6 shift to extended
F7 expand macro to text             F8 goto graphics mode
F9 on-line help                     F10  save file, exit   
shift F5  search and replace       
shift F7  copy file into text 
shift F8  enter character editor
shift F9  save or print all or partial file
shift F10 abandon edited file and exit

SPRITE EDITOR

F1 select sprite                    F2 select layout
F3 copy to sprite                   F4 copy to image
F5 load sprite table                F6 save sprite table
F7 load image                       F8 save image
F9 goto fat bits mode               F10 exit
arrows roll graphics image 1 pixel


SPRITE EDITOR FAT BITS MODE

F1 set a pixel                      ^F1 stream set
F2 clear a pixel                    ^F2 stream clear
F8 change screen mode               ^F5 clear sprite
F10 exit fat bits mode
+ and - change background colors


APPENDIX B: PILOT CHARACTER SET

OUTPUT CHARACTERS

PILOT allows the use of characters in the range of ascii 32 (space) through 
ascii 255. On the IBM PC these are all considered "printable" characters. 
That is, all are displayed on the screen if typed by a T: statement. The 
characters in the range of 0 to 31 are not printable; these are reserved for 
terminal control functions. (See table below.) Any control character that has 
not been assigned a function is ignored completely upon output. The EZ editor 
allows the user to place any character from 32 to 255 in a program file. It 
does not allow characters from 0 to 31 to be put in a file. If you use a text 
editor which does allow control characters to be placed in the text, you 
should also avoid doing so when creating a PILOT program.  

       CHR(8)  - backspace
       CHR(9)  - forward space
       CHR(10) - cursor down
       CHR(11) - cursor up
       CHR(12) - clear screen
       CHR(13) - return (newline)
       CHR(14) - home

The characters from 32 to 127 display the same in all screen modes of PILOT. 
These are as shown on pages G2 and G3 of appendix G of the BASIC manual. (You 
might consider moving those pages to this appendix for future reference.) 

There is a difference in what you see on the screen for 
characters in the range 128 to 255 depending on what screen mode the PILOT 
program uses. In modes 0 through 3 (the text modes) the characters displayed 
are as shown on pages G4 and G5 of appendix G of the BASIC manual.  

In modes 4 through 6 (the graphics modes) the characters from 128 to 255 are 
handled in a special way. These are the characters that are available for 
user defined characters (see the NEW CHARACTER statement). If you do not 
define any character patterns (that is you do not execute any N: statements) 
then the characters from 128 to 255 have unpredictable shapes and should not 
be used at all.  Once you define at least one character then the remainder of 
the characters in this range have the same shapes as the corresponding 
characters in the range 0 to 127 as shown in BASIC appendix G. You can define 
new shapes for any or all of the 128 characters in this range. You can not 
change the shapes of the characters below 128.  

ENTERING CHARACTERS WITH EZ

EZ allows the user to enter characters from 32 to 255 into the text. The 
characters from 32 to 127 are easily entered in the natural way by just 
pushing the key with the appropriately marked character on the keyboard. To 
enter characters from 128 to 255 the user first pushes the F6 key then pushes 
a second key. The character entered into the text is the value of the second 
key plus 128. For example F6 # yields the character 35+128=163 or u-accent. 
(See chart below.) If you  wish to enter several extended characters in a 
row, push SHIFT-F6.  Then all characters are changed in the above manner 
until you push F6 again or push the ENTER key.  

KEY TO PUSH AFTER F6 TO ENTER CHARACTERS 128 to 255 WITH EZ  


128 ctrl-@               160 space
129 ctrl-A               161 !
130 ctrl-B               162 "
131 ctrl-C               163 #
132 ctrl-D               164 $
133 ctrl-E               165 %
134 ctrl-F               166 &
135 ctrl-G               167 '
136 ctrl-H               168 (
137 ctrl-I               169 )
138 ctrl-J               170 *
139 ctrl-K               171 +
140 ctrl-L               172 ,
141 ctrl-M               173 -
142 ctrl-N               174 .
143 ctrl-O               175 /
144 ctrl-P               176 0
145 ctrl-Q               177 1
146 ctrl-R               178 2
147 ctrl-S               179 3
148 ctrl-T               180 4
149 ctrl-U               181 5
150 ctrl-V               182 6
151 ctrl-W               183 7
152 ctrl-X               184 8
153 ctrl-Y               185 9
154 ctrl-Z               186 :
155 ctrl-[               187 ;
156 ctrl-\               188 <
157 ctrl-]               189 =
158 ctrl-^               190 >
159 ctrl-_               191 ?
                                                       

