Amos Professional Manual  Contents  Index

Using the Keyboard


For example:

E> Print "Type in a number"
   Input A
   Print "Your number was ";A
   Input "Type in a floating point number";N#
   Print "Your number was ";N#
   Input "What's your name?";Name$
   Locate 23, : Print "Hello ";Name$

LINE INPUT
instruction: input a list of variables separated by [Return]
Line Input variables;
Line Input "Prompt string";variables;

LINE INPUT is identical in usage to INPUT, except that is uses a press of the [Return] key to separate each value you enter via the keyboard instead of a comma. Try this:

E> Line Input "Type in three numbers";A,B,C
   Print A,B,C

PUT KEY
instruction:load a string into the keyboard buffer
Put Key a$

This command loads a string of characters directly into the keyboard buffer, and it is most commonly used to set up defaults for your INPUT routines. Note that end of line returns can be included using a CHR$(13) character. In the next example, "NO" is assigned to the default INPUT string.

E> Do
    Put Key "NO"
    Input "Do you love me, Yes or No: ";A$
    B$=Upper$(A$)
    If B$="NO" Then Boom : Wait 50: Exit
   Loop

Keyboard Macros
AMOS Professional allows the creation of keyboard macros from the [Macros] option of the main [Editor] Menu, as detailed in Chapter 4.1. A macro is simply a command string assigned to one of the function keys, which is called up by pressing the appropriate function key and one of the [Amiga] keys together. Once a macro has been defined, it can be used anywhere within the AMOS Professional system, and will have exactly the same effect as if the assigned commands had been entered from the keyboard. The same macro can be called from the Editor window, from Direct mode, or from inside an AMOS Professional program.

As well as assigning macro definitions by means of the [Macro] option in the Editor, they can also be defined directly from an AMOS Professional program using the powerful KEY$ reserved variable.

Back    Next
10.01.05