The programmable function keys

The function keys are a very powerful extension to the capabilities of PIP. With the graphics possibilities of the simulator, sometimes you want to write very complex programs. For examples, you might want to produce a "star of stars" graphic like this:

You could write the program like this:

but the structure of the graphic would not be very clear.

The element:

draws a star. It would be nice if we could write a program for this in a separate area and refer to it by name whenever we wanted it. The programmable function keys allow you to do this.

There are three elements to the function keys. The top one is the name of the function. These start off as "function 1" and "function 2" but you can change the name to anything you like by clicking on it and typing.

The next element is the ability to change what the function key does. When you click on "change" the program text space shows you what the function key does at the moment and the keyboard at the bottom right enables you to change it to anything you like. When you press "change" the caption changes to "end change". You press this when you have finished the change.

The last element is the "use" button. When you want to use the function, you press the "use" button. The name of the function appears in the program space where the function is used. You can use the function keys anywhere to the right of themselves. So you can use the left function in the right function or the main program, and the right function in the main program only. You can never use a function inside itself.

To use a function key in the program to draw the stars; first click on the left-hand function name, rub out the existing name with backspace and/or delete and type in "star". Next click on "change" for the left-hand function. If there is a program already there, it will appear in the program text space. Enter these keys:

Now you have programmed the function, press "end change" to get back to the main program.

The main program to draw the stars is:

star

Where "star" appears press the "use" button for the star function.

Now you have the function for "star", you can use it wherever you like. For example, a square with a star at each corner is:

star

The function keys allow you to have a couple of standard patterns that you can use wherever you like in your main program. You can use them as many times as you like without having to enter the program steps in again.

 

Date Last Modified: 12/9/01