• Aucun résultat trouvé

Softkeys and Saftkey Control

Dans le document Using HP BASIC/UX 6.2 (Page 178-182)

ITF Keyboards

11 Softkeys and Saftkey Control

There are eight softkeys (labeled @ through @) and two keys that control the definitions of the softkeys ((Menu) and (System ). Refer to chapter 4 for a discussion of menus and key labels.

When the BASIC system is booted, the softkeys default to System mode and the System menu appears at the bottom of your display. System softkeys are defined following control key definitions. In addition to the System mode, there are three User modes: User 1, User 2, and User 3. HP BASIC Programming Guide describes how to set up User modes.

Softkey Control Keys

To assume System mode, press unshifted-(system ) . . The System menu is displayed, if the (Menu) key is toggled to the on position.

Press (Used (( Shift

H

System l) to put the soft keys in User mode. A User menu is displayed if the (Menu) key is toggled to the on position.

The system remembers which User menu you are in when you press the (System) key and returns to that menu when you press the (User) key. A second press of the (User) key always goes to the User 1 menu. There are additional iterations with EDIT mode; see "Softkey Menu Changes"

in the "Editing and Storing Programs" chapter for details.

Press unshifted-( Menu) to toggle the softkey labels; it turns them on if they're off and turns them off if they're on.

Press (Shift

H

Menu) to increment User mode and menu if User mode is on.

Try the following exercises to learn how the two control keys work.

First, get the System mode selected and menu displayed. If the System menu is not displayed, press (System ). If it is still not displayed, press (Menu ).

With the System menu displayed, press unshifted-(Menu) several times. The system menu display should go on and off. Leave the System menu displayed, and continue.

11-12 Keyboard Information

N ow press (Shift HUser ). The User 1 menu appears on your display.

Press (Shift HMenu) several times. The displayed menus should rotate successively through the three User menus (User 1 --7- User 2 --7- User 3 --7-User 1 --7- User 2, etc.).

Press unshifted-{Menu) several times and the last User menu goes on and off.

Leave the User menu on.

Press unshifted-(sxstem) to return to the System menu.

System Softkeys

The following paragraphs define the eight System softkeys.

(unshifted-@) lets you execute one program line at a time. This is useful for debugging programs.

;;Eg~I~!HI]I (unshifted-@) resumes program

execution from the point where it was paused (by an

unshifted-~) .

~~R!i (unshifted-@) starts a program running from the beginning.

The i~~~RI;;;;:~!:~~; key (unshifted-@) turns the printall mode on and off, allowing keyboard operations and displayed error messages to be copied to a printall device.

Press Ig~;~111;;~~~1! once to set printall on and again to set printall off. An asterisk (*) appears next to All to indicate that printall is on.

The display's output area is the default printall device at powerup. HP BASIC Programming Guide explains how to select other printall devices.

Press~I~~~I;I~~;;I to turn on printall mode. Now type the followingc~mm~nd :

PRINT IITHIS IS A KEYBOARD OPERATION"

(R'etljffi)

Keyboard Information 11-13

11

11 Both the PRINT command and the message are displayed on the screen, (the default printall device). Now type:

THIS WILL CAUSE AN ERROR (Return)

Because this is not an executable BASIC statement, an error message is displayed, both at the bottom of the screen and in the printall area at the top. A log is produced of all commands typed and executed at the keyboard, along with any error messages. Press

(Clear display) to clear the display, and press lRI~~ll;:ll:;I~I!l to turn off printall mode.

(unshifted-@) sets a tab at the cursor's current Tabs remain in effect until cleared by either

or the SCRATCH A statement (explained in HP BASIC Programming Guide).

ll;~I:l'::;::=I~i::: ({Shift )-@) clears a tab previously set at the cursor's position.

Press the space bar to move the cursor forward a few spaces and press Move the cursor back several spaces using

(3),

then press (Tab ). Move the cursor

forward several more spaces with the space bar, then press (ShiftHTab ). To clear the tab, movethe cursor to the unwanted tab position and press Press

(ShiftHClear line) when finished.

::~~I':I:!m:II::!;;:iIIIIII;: (unshifted-@) sets the display-functions mode, allowing you to see special control characters (e.g., form-feed, carriage return) on the screen. Pressing this key a second time cancels the display-functions mode.

An asterisk (*) appears next to Fetns to indicate that display-functions mode is on.

Type the following line:

PRINT "DISPLAY-FUNCTIONS MODE OFF" (Return)

11·14 Keyboard Information

Notice the display at the top of the screen. Now press :.:.:.:.:.:.:.:.:.:.: ... :: ... :.:.:.:.: .. : ... :.:.: ... :.:.:.:.:.:.::.:.:.:.:. (unshifted-@) to recall the line, and edit it to read:

PRINT "DISPLAY-FUNCTIONS MODE ON"

Press and then press

(RetijT).

Notice that the carriage return (CR) and line-feed (LF) control characters are now displayed. Press 1::::::*~l? .;;::::g~~:I::: again to exit display-functions mode. Press (Clear display) when finished.

(unshifted-@) is used to find any ASCII character. First press!~~y ls~;IL The following message appears above the menu:

Enter 3 digits, 000 to 255

Enter a three-digit number from 000 through 255

representing the decimal equivalent of an ASCII character.

The computer automatically displays the character on the screen. For a list of characters and their equivalent decimal values, see the US ASCII Character Codes table in the "Useful Tables" section of the HP BASIC 6.2 Language Reference.

Press !~Rl{"sl~t, then type 65 which is the decimal equivalent of A. The display line now displays A. Press

(Shift

H

Clear line) to erase it.

The soft key (unshifted-@) acts just like System Control @ (described earlier).ll~;sl~~;l recalls the last line that you entered, executed, or deleted. Several previous lines can be recalled this waY.;!I!I~~!::l is particularly useful when you mistype a line. Instead of retyping the entire line, you can recall it, edit it using the editing keys, and enter or execute it again.

Keyboard Information 11-15

11

11 Type:

PRINT II 111

(R'et"U'T)

to print the number 1 on the screen. Now press

·11!]I;!:li;!

to recall the PRINT statement. Edit the statem~~'t''''''''t'~'''''''''''''''''' print the number 2 by positioning the cursor under the 1 and typing

(1)

over it. Press (Return) again. Now press

several times to see all of the statements it

remembers. Note that: . goes backward through the queue.

Press (Shift ~@ to cycle forward through the queue until the last line entered, executed, or deleted is displayed. In the previous exercise you pressed unshifted-@ several times, cycling backward through the queue. Now press

(Shift ~@ several times to cycle forward through the queue until the last line is displayed.

Dans le document Using HP BASIC/UX 6.2 (Page 178-182)