Capítulo 4
El Editor de plena pantalla de GW-BASIC

Usted puede corregir líneas de programa de GW-BASIC como usted las incorpora, o después de que se han ahorrado en un archivo del programa.

4.1 Corregir líneas en archivos nuevos

Si se incorpora un carácter incorrecto mientras que se está mecanografiando una línea, puede ser suprimida con la TECLA DE RETROCESO o el DEL keys, o con CTRL-H. Después de que se suprima el carácter, usted puede continuar mecanografiando en la línea.

La tecla de salida Le deja suprimir una línea de la pantalla que está en el proceso de ser mecanografiado. Es decir si usted no ha presionado la llave DE VUELTA, y usted desee suprimir la línea actual de la entrada, presionan la tecla de salida .

Para suprimir el programa entero que reside actualmente en memoria, incorpore el NUEVO comando. NUEVO se utiliza generalmente a la memoria clara antes de incorporar un nuevo programa.

4.2 Corregir líneas en archivos ahorrados

Después de que usted haya incorporado su programa de GW-BASIC y lo haya ahorrado, usted puede descubrir que usted necesita realizar algunos cambios. Para hacer estas modificaciones, utilice la declaración de la LISTA para exhibir las líneas de programa se afectan que:

  1. Recargue el programa.
  2. Mecanografíe el comando de la LISTA, o presione la llave F1.
  3. Mecanografíe la línea número, o la gama de números, para ser corregido.

Las líneas aparecerán en su pantalla.

4.2.1 Corregir la información en una línea de programa

Usted puede realizar cambios a la información en una línea colocando el cursor donde está ser hecha el cambio, y haciendo uno del siguiente:

Si usted ha cambiado más de una línea, sea seguro presionar VUELTA en cada línea modificada. Las líneas modificadas serán almacenadas en la secuencia numérica apropiada, incluso si las líneas no se ponen al día en orden numérica.


Nota

Una línea de programa no tendrá realmente cambios registrados dentro del programa de GW-BASIC hasta que la llave DE VUELTA se presiona con el cursor colocado en alguna parte en la línea corregida.


Usted no tiene que mover el cursor al extremo de la línea antes de presionar la llave DE VUELTA. El intérprete de GW-BASIC recuerda donde cada línea termina, y transfiere la línea entera, incluso si se presiona la VUELTA mientras que el cursor está situado en el centro o en el principio de la línea.

Para truncar, o para cortar, una línea en la posición actual del cursor, mecanografía CTRL-END o CTRL-E, seguido presionando la llave DE VUELTA.

Si usted ha ahorrado originalmente su programa a un archivo del programa, cerciórese de que usted ahorre la versión corregida de su programa. Si usted no hace esto, sus modificaciones no serán registradas.

4.3 Llaves Especiales

El intérprete de GW-BASIC reconoce nueve de las llaves numéricas en el derecho de su teclado. También reconoce la llave de TECLA DE RETROCESO, la tecla de salida , y la llave de CTRL. Las llaves siguientes y las secuencias dominantes tienen funciones especiales en GW-BASIC:

Llave Función
TECLA DE RETROCESO o CTRL-H Suprime el carácter pasado mecanografiado, o suprime el carácter a la izquierda del cursor. Todos los caracteres a la derecha del cursor se mueven a la izquierda una posición. Los caracteres y las líneas subsecuentes dentro de la línea lógica actual se levantan como con el DEL key.
CTRL-BREAK o CTRL-C Vueltas al modo directo, sin los cambios del ahorro realizados a la línea actual. También dará salida a modo auto de la li'nea-enumeracio'n.
CTRL-CURSOR DEJADO o CTRL-B Mueve el cursor al principio de la palabra anterior. La palabra anterior se define como el carácter siguiente a la izquierda del cursor en el sistema A a Z o en el sistema 0 a 9.
CTRL-CURSOR ENDEREZAN o CTRL-F Mueve el cursor al principio de la palabra siguiente. La palabra siguiente se define como el carácter siguiente a la derecha del cursor en el sistema A a Z o en el sistema 0 a 9. Es decir el cursor se mueve al número o a la letra siguiente después del espacio en blanco o del otro carácter especial.
CURSOR ABAJO o CTRL --   Mueve el cursor abajo de una línea en la pantalla.
CURSOR DEJADO o CTRL - ]   Mueve la posición del cursor uno a la izquierda. Cuando el cursor se avanza más allá del borde izquierdo de la pantalla, se envolverá al derecho de la pantalla en la línea precedente.
- \ de la DERECHA o de CTRL del CURSOR Mueve la derecha de la posición del cursor uno. Cuando el cursor se avanza más allá del borde derecho de la pantalla, se envolverá al lado izquierdo de la pantalla en la línea siguiente.
CURSOR ASCENDENTE o CTRL-6 Mueve el cursor encima de una línea en la pantalla.
CTRL-BACKSPACE o DEL Suprime el carácter colocado sobre el cursor. Todos los caracteres a la derecha de el que esta' suprimido entonces se mueven una posición a la izquierda a completan donde estaba made.If la canceladura que una línea lógica amplía más allá de una línea física, los caracteres en líneas subsecuentes se mueven a la izquierda una posición a completan el espacio anterior, y el carácter en la primera columna de cada línea subsecuente se mueve hasta el extremo de la línea precedente.DEL (cancelación) es el contrario de INS (relleno). Suprimir el texto reduce la línea longitud lógica.
CTRL-END o CTRL-E Borra de la posición del cursor al extremo de la línea lógica. Se borran todas las líneas físicas de la pantalla hasta que se encuentra la VUELTA que termina.
CTRL-N o EXTREMO Mueve el cursor al extremo de la línea lógica. Los caracteres mecanografiados de esta posición se agregan a la línea.
CTRL-RETURN o CTRL-J Mueve el cursor al principio de la línea siguiente de la pantalla. Esto le deja crear las líneas de programa lógicas que son más largas que la anchura física de la pantalla. Las líneas lógicas pueden ser hasta 255 caracteres de largo. Esta función se puede también utilizar como avance de línea.
CTRL-M o VUELTA  Incorpora una línea en el programa de GW-BASIC. También mueve el cursor a la línea lógica siguiente.
CTRL-[ o salida Borra la línea lógica entera en la cual el cursor está situado.
CTRL-G Hace una señal sonora emitir del altavoz de su computadora.
CTRL-K o CASERO Mueve el cursor a la esquina izquierda superior de la pantalla. El contenido de la pantalla es sin cambios.
CTRL-HOME o CTRL-L Despeja la pantalla y coloca el cursor en la esquina izquierda superior de la pantalla.
CTRL-R o INS Da vuelta al modo de relleno por intervalos. El modo de relleno es indicado por el cursor que borra la mitad inferior de la posición de carácter. En modo de gráficos, el cursor normal cubre la posición de carácter entera. Cuando el modo de relleno es activo, sólo la mitad inferior de la posición de carácter es escondida por el cursor.

Cuando el modo de relleno está apagado, los caracteres mecanografiados substituyen caracteres existentes en la línea. El ESPACIADOR borra el carácter en la posición actual del cursor y mueve el carácter del cursor uno a la derecha. La llave de CURSOR-RIGHT mueve el carácter del cursor uno a la derecha, pero no suprime el carácter.

Cuando el modo de relleno está apagado, presionar el tabulador mueve el cursor sobre caracteres hasta que se alcanza la interrupción de la tabulación siguiente. Las interrupciones de la tabulación ocurren cada ocho posiciones de carácter.

Cuando el modo de relleno está encendido, los caracteres que siguen el cursor se mueven a la derecha mientras que los caracteres mecanografiados se insertan antes de ellos en la posición actual del cursor. Después de cada golpe de teclado, el cursor mueve una posición a la derecha. Se observa la línea el envolverse. Es decir, como los caracteres se mueven del derecho de la pantalla, se insertan de la izquierda en líneas subsecuentes. Las inserciones aumentan la línea longitud lógica.

Cuando el modo de relleno está encendido, presionar el tabulador hace espacios en blanco ser insertada de la posición actual del cursor a la interrupción de la tabulación siguiente. La línea el envolverse se observa como arriba.

CERRADURA de CTRL-NUM o CTRL-S Coloca la computadora en un estado de la pausa. Para reasumir la operación, presione cualquier otra llave.
CTRL-PRTSC Causa los caracteres impresos en la pantalla para repetir a la línea impresora (lpt1:). Es decir usted imprimirá lo que usted mecanografía en la pantalla. Presionar CTRL-PRTSC una segunda vez da vuelta apagado a repetir de caracteres a lpt1:.
CAMBIO + PRTSC Envía el contenido actual de la pantalla a la impresora, creando con eficacia una foto de la pantalla.
CTRL-I o LENGÜETA Mueve el cursor a la interrupción de la tabulación siguiente. Las interrupciones de la tabulación ocurren cada ocho columnas.

4.4 Llaves De Funcionamiento

Las ciertas llaves o combinaciones de llaves le dejaron realizar comandos o funciones frecuente-usados con un número mínimo de golpes de teclado. Estas llaves se llaman las llaves de funcionamiento.

Las llaves de funcionamiento especiales que aparecen en el lado izquierdo de su teclado se pueden redefinir temporalmente para resolver los requisitos de programación y las funciones específicas que su programa puede requerir.

Las llaves de funcionamiento permiten la entrada rápida de tanto como 15 caracteres en un programa con un golpe de teclado. Estas llaves están situadas en el lado izquierdo de su teclado y etiquetadas F1 con F10. GW-BASIC ha asignado ya funciones especiales a cada uno de estas llaves. Usted notará eso después de usted la carga GW-BASIC, estas funciones dominantes especiales aparece en el fondo de su pantalla. Estas asignaciones dominantes se han seleccionado para usted como algunos de los comandos lo más con frecuencia posible usados.

Inicialmente, las llaves de funcionamiento se asignan las funciones especiales siguientes:

Tabla 4.1

Asignaciones De la Llave De Funcionamiento de GW-BASIC

Llave Función Llave Función
F1 LISTA F6 , "lpt1:".
F2 FUNCIONAMIENTO. F7 TRON.
F3 CARGA " F8 TROFF.
F4 EXCEPTO " F9 LLAVE
F5 CONTINUADO. F10 PANTALLA 0.0.0.



Nota

. después de una función indica que usted no necesita presionar la llave DE VUELTA después de la llave de funcionamiento. El comando seleccionado será ejecutado inmediatamente.


Si usted elige, usted puede cambiar las asignaciones de estas llaves. O todas las 10 llaves de funcionamiento puede ser redefinido. Para más información, vea la LLAVE y EN las declaraciones DOMINANTES en la referencia del usuario de GW-BASIC.

----

Chapter 4
The GW-BASIC Screen Editor

You can edit GW-BASIC program lines as you enter them, or after they have been saved in a program file.

4.1 Editing Lines in New Files

If an incorrect character is entered as a line is being typed, it can be deleted with the BACKSPACE or DEL keys, or with CTRL-H. After the character is deleted, you can continue to type on the line.

The ESC key lets you delete a line from the screen that is in the process of being typed. In other words, if you have not pressed the RETURN key, and you wish to delete the current line of entry, press the ESC key.

To delete the entire program currently residing in memory, enter the NEW command. NEW is usually used to clear memory prior to entering a new program.

4.2 Editing Lines in Saved Files

After you have entered your GW-BASIC program and saved it, you may discover that you need to make some changes. To make these modifications, use the LIST statement to display the program lines that are affected:

  1. Reload the program.
  2. Type the LIST command, or press the F1 key.
  3. Type the line number, or range of numbers, to be edited.

The lines will appear on your screen.

4.2.1 Editing the Information in a Program Line

You can make changes to the information in a line by positioning the cursor where the change is to be made, and by doing one of the following:

If you have changed more than one line, be sure to press RETURN on each modified line. The modified lines will be stored in the proper numerical sequence, even if the lines are not updated in numerical order.


Note

A program line will not actually have changes recorded within the GW-BASIC program until the RETURN key is pressed with the cursor positioned somewhere on the edited line.


You do not have to move the cursor to the end of the line before pressing the RETURN key. The GW-BASIC Interpreter remembers where each line ends, and transfers the whole line, even if RETURN is pressed while the cursor is located in the middle or at the beginning of the line.

To truncate, or cut off, a line at the current cursor position, type CTRL-END or CTRL-E, followed by pressing the RETURN key.

If you have originally saved your program to a program file, make sure that you save the edited version of your program. If you do not do this, your modifications will not be recorded.

4.3 Special Keys

The GW-BASIC Interpreter recognizes nine of the numeric keys on the right side of your keyboard. It also recognizes the BACKSPACE key, ESC key, and the CTRL key. The following keys and key sequences have special functions in GW-BASIC:

Key Function
BACKSPACE or CTRL-H Deletes the last character typed, or deletes the character to the left of the cursor. All characters to the right of the cursor are moved left one position. Subsequent characters and lines within the current logical line are moved up as with the DEL key.
CTRL-BREAK or CTRL-C Returns to the direct mode, without saving changes made to the current line. It will also exit auto line-numbering mode.
CTRL-CURSOR LEFT or CTRL-B Moves the cursor to the beginning of the previous word. The previous word is defined as the next character to the left of the cursor in the set A to Z or in the set 0 to 9.
CTRL-CURSOR RIGHT or CTRL-F Moves the cursor to the beginning of the next word. The next word is defined as the next character to the right of the cursor in the set A to Z or in the set 0 to 9. In other words, the cursor moves to the next number or letter after a blank or other special character.
CURSOR DOWN or CTRL--   Moves the cursor down one line on the screen.
CURSOR LEFT or CTRL-]   Moves the cursor one position left. When the cursor is advanced beyond the left edge of the screen, it will wrap to the right side of the screen on the preceding line.
CURSOR RIGHT or CTRL-\ Moves the cursor one position right. When the cursor is advanced beyond the right edge of the screen, it will wrap to the left side of the screen on the following line.
CURSOR UP or CTRL-6 Moves the cursor up one line on the screen.
CTRL-BACKSPACE or DEL Deletes the character positioned over the cursor. All characters to the right of the one deleted are then moved one position left to fill in where the deletion was made.If a logical line extends beyond one physical line, characters on subsequent lines are moved left one position to fill in the previous space, and the character in the first column of each subsequent line is moved up to the end of the preceding line.DEL (delete) is the opposite of INS (insert). Deleting text reduces logical line length.
CTRL-END or CTRL-E Erases from the cursor position to the end of the logical line. All physical screen lines are erased until the terminating RETURN is found.
CTRL-N or END Moves the cursor to the end of the logical line. Characters typed from this position are added to the line.
CTRL-RETURN or CTRL-J Moves the cursor to the beginning of the next screen line. This lets you create logical program lines which are longer than the physical screen width. Logical lines may be up to 255 characters long. This function may also be used as a line feed.
CTRL-M or RETURN  Enters a line into the GW-BASIC program. It also moves the cursor to the next logical line.
CTRL-[ or ESC Erases the entire logical line on which the cursor is located.
CTRL-G Causes a beep to emit from your computer's speaker.
CTRL-K or HOME Moves the cursor to the upper left corner of the screen. The screen contents are unchanged.
CTRL-HOME or CTRL-L Clears the screen and positions the cursor in the upper left corner of the screen.
CTRL-R or INS Turns the Insert Mode on and off. Insert Mode is indicated by the cursor blotting the lower half of the character position. In Graphics Mode, the normal cursor covers the whole character position. When Insert Mode is active, only the lower half of the character position is blanked by the cursor.

When Insert Mode is off, characters typed replace existing characters on the line. The SPACEBAR erases the character at the current cursor position and moves the cursor one character to the right. The CURSOR-RIGHT key moves the cursor one character to the right, but does not delete the character.

When Insert Mode is off, pressing the TAB key moves the cursor over characters until the next tab stop is reached. Tab stops occur every eight character positions.

When Insert Mode is on, characters following the cursor are moved to the right as typed characters are inserted before them at the current cursor position. After each keystroke, the cursor moves one position to the right. Line wrapping is observed. That is, as characters move off the right side of the screen, they are inserted from the left on subsequent lines. Insertions increase logical line length.

When Insert Mode is on, pressing the TAB key causes blanks to be inserted from current cursor position to the next tab stop. Line wrapping is observed as above.

CTRL-NUM LOCK or CTRL-S Places the computer in a pause state. To resume operation, press any other key.
CTRL-PRTSC Causes characters printed on the screen to echo to the line printer (lpt1:). In other words, you will be printing what you type on the screen. Pressing CTRL-PRTSC a second time turns off the echoing of characters to lpt1:.
SHIFT + PRTSC Sends the current screen contents to the printer, effectively creating a snapshot of the screen.
CTRL-I or TAB Moves the cursor to the next tab stop. Tab stops occur every eight columns.

4.4 Function Keys

Certain keys or combinations of keys let you perform frequently-used commands or functions with a minimum number of keystrokes. These keys are called function keys.

The special function keys that appear on the left side of your keyboard can be temporarily redefined to meet the programming requirements and specific functions that your program may require.

Function keys allow rapid entry of as many as 15 characters into a program with one keystroke. These keys are located on the left side of your keyboard and are labeled F1 through F10. GW-BASIC has already assigned special functions to each of these keys. You will notice that after you load GW-BASIC, these special key functions appear on the bottom line of your screen. These key assignments have been selected for you as some of the most frequently used commands.

Initially, the function keys are assigned the following special functions:

Table 4.1

GW-BASIC Function Key Assignments

Key Function Key Function
F1 LIST F6 ,"LPT1:"¿
F2 RUN¿ F7 TRON¿
F3 LOAD" F8 TROFF¿
F4 SAVE" F9 KEY
F5 CONT¿ F10 SCREEN 0,0,0¿



Note

The ¿ following a function indicates that you needn't press the RETURN key after the function key. The selected command will be immediately executed.


If you choose, you may change the assignments of these keys. Any one or all of the 10 function keys may be redefined. For more information, see the KEY and ON KEY statements in the GW-BASIC User's Reference.

1